Wednesday, 8 August 2012

.Net and Sql Server Interview questions and answers

I am writhing this blog for freshers and professionals. i think it will be very helpful to all freshers and others.
------------------------------------------------------------------------------------------------------------
1.
What is ASP.NET?

ASP.NET is a server side scripting technology that enables scripts (embedded in web pages) to be executed by an Internet server.
ASP.NET provides increased performance by running compiled code.


2.
What is the difference between Classic ASP and ASP.Net?

ASP is Interpreted language based on scripting languages like Jscript or VBScript.
§  ASP has Mixed HTML and coding logic.
§  Limited development and debugging tools available.
§  Limited OOPS support.
§  Limited session and application state management.
ASP.Net is supported by compiler and has compiled language support.
§  Separate code and design logic possible.
§  Variety of compilers and tools available including the Visual studio.Net.
§  Completely Object Oriented.
§  Complete session and application state management.
§  Full XML Support for easy data exchange.

3.
What is Difference between Namespace and Assembly?

Namespace is a logical design-time naming convenience, whereas an assembly establishes the name scope for types at run time.

4.
What is the difference between early binding and late binding?

Calling a non-virtual method, decided at a compile time is known as early binding. Calling a virtual method (Pure Polymorphism), decided at a runtime is known as late binding.

5.
What is the difference between ASP Session State and ASP.Net Session State?

ASP session state relies on cookies, Serialize all requests from a client, does not survive process shutdown, Can not maintained across machines in a Web farm.

6.
What is the difference between ASP Session and ASP.NET Session?

Asp.net session supports cookie less session & it can span across multiple servers.

7.
What is reflection?

All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection.
The System.Reflection namespace contains classes that can be used to interrogate the types for a module/assembly.

8.
What is the difference between Server.Transfer and response.Redirect?

The Server.Transfer () method stops the current page from executing, and runs the content on the specified page, when the execution is complete the control is passed back to the calling page.
While the Response.Redirect () method transfers the control on the specified page and the control is never passed back to calling page after execution.
9.
What is a PostBack?

The process in which a Web page sends data back to the same page on the server.

10.
What namespace does the Web page belong in the .NET Framework class hierarchy?

System.Web.UI.Page

11.
What’s a bubbled event?

When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their event handlers, allowing the main DataGrid event handler to take care of its constituents.

12.
What is the difference between Server-side and Client-side code?

§  Server-side code executes on the server.
§  Client-side code executes in the client’s browser.

13.
What is the difference between static or dynamic assemblies?

Assemblies can be static or dynamic.

Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in portable executable (PE) files.

Dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.

14.
What are the difference between Structure and Class?

§  Structures are value type and Classes are reference type
§  Structures can not have constructor or destructors.
§  Classes can have both constructor and destructors.
§  Structures do not support Inheritance, while Classes support Inheritance.

15.
What is the differences between dataset.clone and dataset.copy?

Dataset.clone copies just the structure of dataset (including all the datatables, schemas, relations and constraints.); however it doesn’t copy the data.
Dataset.copy, copies both the dataset structure and the data.

16.
What is the difference between Custom Control and User Control?

Custom Controls are compiled code (Dlls), easier to use, difficult to create, and can be placed in toolbox. Drag and Drop controls. Attributes can be set visually at design time. Can be used by Multiple Applications (If Shared Dlls), Even if Private can copy to bin directory of web application add reference and use. Normally designed to provide common functionality independent of consuming Application.
User Controls are similar to those of ASP include files, easy to create, can not be placed in the toolbox and dragged - dropped from it. A User Control is shared among the single application files.
17.
What is the difference between ASP Session State and ASP.Net Session State?

ASP session state relies on cookies, Serialize all requests from a client, does not survive process shutdown, Can not maintained across machines in a Web farm.

18.
What is ViewState?

ViewState is a .Net mechanism to store the posted data among post backs. ViewState allows the state of objects to be stored in a hidden field on the page, saved on client side and transported back to server whenever required.

19.
What is Authentication and Authorization?

Authentication is the process of identifying users. Authentication is identifying/validating the user against the credentials (username and password) and Authorization performs after authentication.
Authorization is the process of granting access to those users based on identity. Authorization allowing access of specific resource to user.

20.
What are the types of Authentication?

There are 3 types of Authentication. Windows, Forms and Passport Authentication.
§  Windows authentication uses the security features integrated into the Windows NT and Windows XP operating systems to authenticate and authorize Web application users.
§  Forms authentication allows you to create your own list/database of users and validate the identity of those users when they visit your Web site.
§  Passport authentication uses the Microsoft centralized authentication provider to identify users. Passport provides a way to for users to use a single identity across multiple Web applications. To use Passport authentication in your Web application, you must install the Passport SDK.

21.
What are the different types of Validation Controls?

There are six types of validation controls available :
§  RequiredFieldValidator
§  RangeValidator
§  RegularExpressionValidator
§  CompareValidator
§  CustomValidator
§  ValidationSummary

22.
What is the Web User Control?

Combines existing Server and/or HTML controls by using VS.Net to create functional units that encapsulate some aspects of UI. Resides in Content Files, which must be included in project in which the controls are used.

23.
What namespaces are necessary to create a localized application?

§  System.Globalization
§  System.Resources

24.
How to Manage State in ASP.Net?

There are several ways to manage a state.
§  ViewState
§  QueryString
§  Cookies
§  Session
§  Application
25.
What are the different types of Caching?

There are three types of Caching :
§  Output Caching: stores the responses from an asp.net page.
§  Fragment Caching: Only caches/stores the portion of page (User Control)
§  Data Caching: is Programmatic way to Cache objects for performance.

26.
What is Side-by-Side Execution?

The CLR allows any versions of the same-shared DLL (shared assembly) to execute at the same time, on the same system, and even in the same process. This concept is known as side-by-side execution.

27.
How to view an assembly?

We can use the tool "ildasm.exe" known as "Assembly Disassembler" to view the assembly.

28.
Which are the namespaces that are imported automatically by Visual Studio in ASP.Net?

There are 7 namespaces which are imported automatically.
§  System
§  System.Collections
§  System.IO
§  System.web
§  System.web.UI
§  System.web.UI.HTMLControls
§  System.web.UI.WebControls.

29.
What are the layouts of ASP.NET Pages?

§  GridLayout
§  FlowLayout
.
GridLayout positions the form object on absolute x and y co-ordinates of the screen.
FlowLayout positions the form objects relative to each other.

30.
What is Delegates?

Delegates are a type-safe, object-oriented implementation of function pointers and are used in many situations where a component needs to call back to the component that is using it. Delegates are generally used as basis of events, which allow any delegate to easily be registered for as event.

31.
What is a Namespace? What is the use of a namespace?

Namespaces are logical grouping of classes and other types in hierarchical structure.
Namespaces are useful to avoid collision or ambiguity among the classes and type names.
Another use of the namespace is to arrange a group of classes for a specific purpose.

32.
What’s the difference between Codebehind="MyCode.aspx.cs" and Src="MyCode.aspx.cs"?

Visual Studio uses the Codebehind attribute to distinguish the page source or programming logic from the design. Also the src attribute will make the page compile on every request. That is the page will not be compiled in advance and stored in the bin as a dll instead it will be compiled at run time.
33.
What is datagrid?

The DataGrid Web server control is a powerful tool for displaying information from a data source. It is easy to use; you can display editable data in a professional-looking grid by setting only a few properties. At the same time, the grid has a sophisticated object model that provides you with great flexibility in how you display the data.

34.
How do you hide the columns?

One way to have columns appear dynamically is to create them at design time, and then to hide or show them as needed. You can do this by setting a column’s “Visible” property.

35.
What are different types of directives in .NET?

§  @Page
§  @Control
§  @Import
§  @Implements
§  @Register
§  @Assembly
§  @OutputCache
§  @Reference

36.
What data type does the RangeValidator control support?

§  Integer
§  String.
§  Date.

37.
What is cookies?

Cookies are small pieces of text, stored on the client’s computer to be used only by the website setting the cookies. This allows web applications to save information for the user, and then re-use it on each page if needed

38.
How many classes can a single .NET DLL contain?

It can contain many classes.

39.
What methods are fired during the page load?

·         Init() - when the page is instantiated.
·         Load() - when the page is loaded into server memory.
·         PreRender() - the brief moment before the page is displayed to the user as HTML.
·         Unload() - when page finishes loading.

40.
What is the difference between Value Types and Reference Types?

Value Types uses Stack to store the data.
where as Reference type uses the Heap to store the data.
41.
What is the difference between Server-side scripting and Client-side scripting?

Server side scripting means that all the script will be executed by the server and interpreted as needed. ASP doesn't have some of the functionality like sockets, uploading, etc.
Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript.

42.
How do you create a permanent cookie?

Permanent cookies are available until a specified expiration date, and are stored on the hard disk.So Set the 'Expires' property any value greater than DataTime.MinValue with respect to the current datetime. If u want the cookie which never expires set its Expires property equal to DateTime.maxValue.

43.
Which method do you use to redirect the user to another page without performing a round trip to the client?

§  Server.Transfer
§  Server.Execute.

44.
Which method do you use to redirect the user to another page without performing a round trip to the client?

Server.transfer

45.
What tag do you use to add a hyperlink column to the DataGrid?

<asp:HyperLinkColumn>< / asp:HyperLinkColumn>

46.
What is web.config file?

Web.config file is the configuration file for the Asp.net web application. There is one web.config file for one asp.net application which configures the particular application. Web.config file is written in XML with specific tags having specific meanings.It includes databa which includes connections,SessionStates,ErrorHandling,Security etc.

47.
What is the difference between in-proc and out-of-proc?

An Inproc is one which runs in the same process area as that of the client giving tha advantage of speed but the disadvantage of stability becoz if it crashes it takes the client application also with it.
Outproc is one which works outside the clients memory thus giving stability to the client, but we have to compromise a bit on speed.

48.
What is a PostBack?

The process in which a Web page sends data back to the same page on the server.
49.
How many languages .NET is supporting now?

When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. The site DotNetLanguages.Net says 44 languages are supported.

50.
What is smart navigation?

The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

51.
How do you validate the controls in an ASP .NET page?

Using special validation controls that are meant for this. We have Range Validator, Email Validator

52.
How do you turn off cookies for one page in your site?

Use Cookie.Discard property, Gets or sets the discard flag set by the server. When true, this property instructs the client application not to save the Cookie on the user's hard disk when a session ends.

53.
Which two properties are on every validation control?

We have two common properties for every validation controls:

§  Control to Validate
§  Error Message

54.
Which control would you use if you needed to make sure the values in two different controls matched?

CompareValidator is used to ensure that two fields are identical.

55.
What is the difference between HTTP-Post and HTTP-Get?

The GET method creates a query string and appends it to the script's URL on the server that handles the request.
The POST method creates a name/value pairs that are passed in the body of the HTTP request message.

56.
What is strong-typing versus weak-typing?

Strong typing implies that the types of variables involved in operations are associated to the variable, checked at compile-time, and require explicit conversion
Weak typing implies that they are associated to the value, checked at run-time, and are implicitly converted as required.
57.
What is boxing and unboxing?

Implicit conversion of value type to reference type of a variable is known as BOXING, for example integer to object type conversion.
Conversion of reference type variable back to value type is called as UnBoxing.

58.
What is garbage collection?

Garbage collection is a system whereby a run-time component takes responsibility for managing the lifetime of objects and the heap memory that they occupy.

59.
What is serialization?

Serialization is the process of converting an object into a stream of bytes.
Deserialization is the opposite process of creating an object from a stream of bytes. Serialization / Deserialization is mostly used to transport objects.

60.
What is the differnce between Managed code and unmanaged code?

Managed Code: Code that runs under a "contract of cooperation" with the common language runtime. Managed code must supply the metadata necessary for the runtimeto provide services such as memory management, cross-language integration, code access security, and automatic lifetime control of objects. All code based on Microsoft intermediate language (MSIL) executes as managed code.

Un-Managed Code:Code that is created without regard for the conventions and requirements of the common language runtime. Unmanaged code executes in the common language runtime environment with minimal services (for example, no garbage collection, limited debugging, and so on).

61.
What is difference between constants, readonly and, static?

§  Constants: The value can’t be changed.
§  Read-only: The value will be initialized only once from the constructor of the class.
§  Static: Value can be initialized once.

62.
What is namespace used for loading assemblies at run time and name the methods?

System.Reflection

63.
How big is the datatypeint in .NET?

32 bits

64.
What is difference between abstract classes and interfaces?

Abstract classes can have concrete methods while interfaces have no methods implemented.
Interfaces do not come in inheriting chain, while abstract classes come in inheritance.
65.
In which event are the controls fully loaded?

Page_load event guarantees that all controls are fully loaded. Controls are also accessed.
In Page_Init events but you will see that viewstate is not fully loaded during this event.

66.
What is the use of @ Register directives?

@Register directive informs the compiler of any custom server control added to the page.

67.
Define RequiredFieldValidator?

It checks whether the control have any value. It's used when you want the control should not be empty.

68.
What are the different types of Session state management options available with ASP.NET?

ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server. Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable.

69.
What are the difference between const and readonly?

§  A constcan not be static, while readonly can be static.
§  A const need to be declared and initialized at declaration only, while a readonly can be initialized at declaration or by the code in the constructor.
§  A const’s value is evaluated at design time, while a readonly’s value is evaluated at runtime.

70.
How do you turn off cookies in one page of your asp.net application?

We may not use them at the max, However to allow the cookies or not, is client side functionality.

71.
What’s the difference between Response.Write () and Response.Output.Write()?

Response.Outout.Write allows us to write the formatted out put.

72.
What is the difference between inline and code behind?

Inline code written along with the html and design blocks in an .aspx page.
Code-behind is code written in a separate file (.cs or .vb) and referenced by the .aspx page.
73.
What is the difference between early binding and late binding?

Calling a non-virtual method, decided at a compile time is known as early binding.
Calling a virtual method (Pure Polymorphism), decided at a runtime is known as late binding.

74.
What is the difference between ASP Session and ASP.NET Session?

Asp.net session supports cookie less session & it can span across multiple servers.

75.
What is Common Language Runtime?

CLR also known as Common Language Run time provides a environment in which program are executed, it activate object, perform security check on them, lay them out in the memory, execute them and garbage collect them.

76.
What is Intermediate Language?

MSIL are also known as Microsoft Intermediate Language is the CPU-independent instruction set into which .Net framework programs are compiled. It contains instructions for loading, storing initializing, and calling methods on objects.

77.
What is CTS?

The Common type system is a rich type system, built into the common language runtime, which supports the types and operations found in most programming languages.

78.
What is Common Langauge Specification?

CLS also known as Common Language Specification defines the rules which all language must support, in order to be a part of .Net framework. The Common Language Specification is a set of constructs and constraints that serves as a guide for library writers and compiler writers.

79.
Which class deals wit the user’s locale information?

System.Web.UI.Page.Culture

80.
What is the lifespan for items stored in ViewState?

Items stored in a ViewState exist for the life of the current page, including the post backs on the same page.
81.
Can we disable ViewState, If, yes how?

ViewState can be disabled by using "EnableViewState" property set to false.

82.
Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines?

All the global declarations or the variables used commonly across the application can be deployed under Application_Start. All the user specific tasks or declarations can be dealt in the Session_Start subroutine.

83.
What is an assembly?

Assemblies are the building blocks of the .NET framework. They are the logical grouping of the functionality in a physical file.

84.
What are different types of Assemblies?

§  Single file and multi file assembly.
§  Assemblies can be static or dynamic.
§  Private assemblies and shared assemblies.

85.
Which method do you invoke on the DataAdapter control to load your generated dataset with data?

DataAdapter’s fill () method is used to fill load the data in dataset.

86.
Which template is to be provided in the Repeater control in order to display a data?

§  ItemTemplate
§  AlternatingItemTemplate.

87.
What are the advantages of an assembly?

§  Increased performance.
§  Better code management and encapsulation.
§  It also introduces the n-tier concepts and business logic.

88.
What is an ArrayList?

The ArrayList object is a collection of items containing a single data type values.
89.
What is a Literal Control?

The Literal control is used to display text on a page. The text is programmable. This control does not let you apply styles to its content.

90.
Which namespaces are used for data access?

§  System.Data
§  System.Data.OleDB
§  System.Data.SQLClient

91.
What is Remoting?

Remoting is a means by which one operating system process, or program, can communicate with another process. The two processes can exist on the same computer or on two computers connected by a LAN or the Internet.

92.
What’s the use of “GLOBAL.ASAX” file?

It allows to executing ASP.NET application level events and setting application-level variables.

93.
What is a SESSION and APPLICATION object?

Session object store information between HTTP requests for a particular user.
Session variables are used to store user specific information where as in application variables we can’t store user specific information.
while application object are global across users.

94.
What is the difference between a Thread and a Process?

A thread is a path of execution that run on CPU, a proccess is a collection of threads that share the same virtual memory.
A process have at least one thread of execution, and a thread always run in a process context.

95.
What's the difference between the Debug class and Trace class?

§  Documentation looks the same.
§  Use Debug class for debug builds.
§  use Trace class for both debug and release builds.

96.
What’s the top .NET class that everything is derived from?

System.Object
97.
How is method overriding different from overloading?

When Overriding, you change the method behavior for a derived class.
Overloading simply involves having a method with the same name within the class.

98.
What is the difference between System.String and System.StringBuilder classes?

§  System.String is immutable.
§  System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.

99.
What is the differences between Server-side and Clientside code?

§  Server side code is executed at the server side on IIS in ASP.NET framework.
§  while client side code is executed on the browser.

100.
What’s an interface?

It’s an abstract class with public abstract methods all of which must be implemented in the inherited classes.

101.
What is a formatter?

A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.

102.
What is Marshalling?

Marshaling is a process of making an object in one process (the server) available to another process (the client). There are two ways to achieve the marshalling.
§  Marshal by value
§  Marshal by reference.

103.
What is a Static class?

Static class is a class which can be used or accessed without creating an instance of the class.
105.
What is a DataSet?

A DataSet is an in memory representation of data loaded from any data source.

106.
What is a DataTable?

A DataTable is a class in .NET Framework and in simple words a DataTable object represents a table from a database.

107.
What is a life span of a static variable?

A static variable’s life span is till the class is in memory

108.
What is the difference between an abstract method & virtual method?

An Abstract method does not provide an implementation and forces overriding to the deriving class (unless the deriving class also an abstract class),
Virtual method has an implementation and leaves an option to override it in the deriving class. Thus Virtual method has an implementation & provides the derived class with the option of overriding it. Abstract method does not provide an implementation & forces the derived class to override the method.

109.
How many namespaces are in .NET version 1.1?

124

110.
What is sealed class

§  Sealed classes are those classes which can not be inherited and thus any sealed class member can not be derived in any other class.
§  A sealed class cannot also be an abstract class.

111.
What are the components of web form in ASP.NET?

§  Server controls
§  HTML controls
§  Data controls
§  System components.

112.
How do you turn off cookies for one page in your site?

Use the Cookie. Discard Property which Gets or sets the discard flag set by the server. When true, this property instructs the client application not to save the Cookie on the users hard disk when a session ends.
113.
What is AutoPostback?

AutoPostBack automatically posts the page back to the server when state of the control is changed.

114.
What is Globalization?

Globalization is the process of creating multilingual application by defining culture specific features like currency, date and time format, calendar and other issues.

115.
What is the main difference between Asp.net and Vb.net?

§  Asp.net is a web technology used for designing webforms and Vb.net is a programming language
§  ASP.NET is a powerful technology for writing dynamic web pages.
§  ASP.NET is a way of creating dynamic web pages while making use of the innovations present in .NET.
§  VB.NET is a language.But ASP.NET is the Environment where we can create websites or webpages.

116.
Is string a value type or a reference type?

Srting is a Reference type.It can create a new instance at every time.

117.
What base class do all Web Forms inherit from?

System.web.UI.Page class

118.
What does assert () do?

In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.

119.
What is cookie less session? How it works?

By default, ASP.NET will store the session state in the same process that processes the request, just as ASP does. If cookies are not available, a session can be tracked by adding a session identifier to the URL.

120.
What is the difference between Compiler and Interpreter?

Compiler:
A compiler is a program that translates program (called source code) written in some high level language into object code.A compiler translates high-level instructions directly into machine language and this process is called compiling.
Interpreter:
An interpreter translates high-level instructions into an intermediate form, which it then executes. Interpreter analyzes and executes each line of source code in succession, without looking at the entire program; the advantage of interpreters is that they can execute a program immediately.
121.
What is the difference between an ADO.NET Dataset and an ADO Recordset?

§  A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
§  A DataSet is designed to work without any continuing connection to the original data source.
§  DataSets have no current record pointer You can use For Each loops to move through the data.
§  Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
§  Data in a DataSet is bulk-loaded, rather than being loaded on demand.
§  You can store many edits in a DataSet, and write them to the original data source in a single operation.

122.
What are the validation controls?

A set of server controls included with ASP.NET that test user input in HTML and Web server controls for programmer-defined requirements. Validation controls perform input checking in server code. If the user is working with a browser that supports DHTML, the validation controls can also perform validation using client script.

123.
What is the difference between “Web.config” and “Machine.Config”?

§  “Web.config” files apply settings to each web application.
§  While “Machine.config” file apply settings to all ASP.NET applications.

124.
What is event bubbling?

Server controls like Data grid, Data List, and Repeater can have other child controls inside them. Example Data Grid can have combo box inside data grid. These child control do not raise there events by themselves, rather they pass the event to the container parent (which can be a data grid, data list, repeater), which passed to the page as “ItemCommand” event. As the child control send events to parent it is termed as event bubbling.

125.
What is the use of @ Register directives?

@Register directive informs the compiler of any custom server control added to the page.

126.
Where is View State information stored?

In HTML Hidden Fields.

127.
What is role based security?

By default, ASP.NET will store the session state in the same process that processes the request, just as ASP does. If cookies are not available, a session can be tracked by adding a session identifier to the URL.

128.
What is the difference between Asp and Asp.net?

ASP (Active Server Pages) and ASP.NET are both server side technologies for building web sites and web applications, ASP.NET is Managed compiled code - asp is interpreted. and ASP.net is fully Object oriented.
ASP.NET has been entirely re-architected to provide a highly productive programming experience based on the .NET Framework, and a robust infrastructure for building reliable and scalable web applications.
129.
What are the various security methods which IIS Provides apart from .NET?

The various security methods which IIS provides are :
§  Authentication Modes.
§  IP Address and Domain Name Restriction.
§  DNS Lookups DNS Lookups.
§  Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
§  The Network ID and Subnet Mask.
§  SSL.

130.
What are Master Pages in ASP.NET?

ASP.NET master pages allow you to create a consistent layout for the pages in your application. A single master page defines the look and feel and standard behavior that you want for all of the pages in your application. You can then create individual content pages that contain the content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.

131.
What are the advantages of ASP.Net?

§  ASP.NET makes development simpler and easier to maintain with an event-driven, server-side programming model.
§  ASP.NET offers built-in security features through windows authentication or other authentication methods.
§  Content and program logic are separated which reduces the inconveniences of program maintenance.
§  Built-in caching features.

132.
What is event bubbling?

Server controls like Data grid, Data List, and Repeater can have other child controls inside them. Example Data Grid can have combo box inside data grid. These child control do not raise there events by themselves, rather they pass the event to the container parent (which can be a data grid, data list, repeater), which passed to the page as “ItemCommand” event. As the child control send events to parent it is termed as event bubbling.

133.
What is WSDL?

WSDL stands for Web Services Description Language is an XML-based language for describing Web services and how to access them.
WSDL is used to describe Web services.
134.
What is the use of @ Register directives?

@Register directive informs the compiler of any custom server control added to the page.

135.
What is the difference between javascript and vbscript?

Javascript :
JavaScript is a client-side scripting language.
JavaScript is used to create interactive web applications supported by the Netscape browser.
JavaScript is simple to use, lightweight, and dynamic. Developers can easily embed code functionality for interactive applications inside a web page.
Javascript is case sensitive and it will be run on client side.
VBScript:
VBScript is a server-side scripting language.
VBScript is not case sensitive and it will be run on server side.

136.
What is a web server?

A web server delivers requested web pages to users who enter the URL in a web browser. Every computer on the Internet that contains a web site must have a web server program.

137.
What are Cascading style sheets?

Cascading style sheets (CSS) collect and organize all of the formatting information applied to HTML elements on a Web form. Because they keep this information in a single location, style sheets make it easy to adjust the appearance of Web applications.

138.
What is the base class of .net?

System.object

139.
What is the base class of Asp.net?

system.Web.UI

140.
what is use of web.config?

§  Web.config is used connect database from front end to back end.
§  Web.config is used to maintain the Appsettimgs instead of static variables
141.
What is difference between abstract classes and interfaces?

Abstract classes can have concrete methods while interfaces have no methods implemented.
Interfaces do not come in inheriting chain, while abstract classes come in inheritance.

142.
What is GAC or Global Assembly Cache?

Global Assembly Cache (GAC) is a common place to share the .NET assemblies across many applications. GAC caches all strong named assembly references within it. All System assemblies that come with the .NET framework reside in the GAC.

143.
What is a HashTable?

The Hashtable object contains items in key/value pairs. The keys are used as indexes, and very quick searches can be made for values by searching through their keys.

144.
What is CAS or Code Access Security?

Code Access Security - CAS is the part of the .NET security model that determines whether or not a piece of code is allowed to run, and what resources it can use when it is running.

145.
What is the Composite Custom Control?

Combination of existing HTML and Server Controls.

146.
What is RangeValidator?

RangeValidator - checks whether a value falls within a given range of number, date or string.

147.
What base class do all Web Forms inherit from?

System.web.UI.Page class

148.
What is the difference between System.String and System.Text.StringBuilder classes?

System.String is immutable.
System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
149.
How to Create a Cookie?

Cookie are one of several ways to store data about web site visitors during the time when web server and browser are not connected. Common use of cookies is to remember users between visits. Practically, cookie is a small text file sent by web server and saved by web browser on client machine.
The“Response.Cookies” command is used to create cookies.

150.
How do you identify a Master Page?

The master page is identified by a special @ Master directive that replaces the @ Page directive that is used for ordinary .aspx pages.

151.
Explain what a diffgram is and a good use for one?

The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. For reading database data to an XML file to be sent to a Web Service.

152.
What is ValidationSummary?

ValidationSummary - It show a summary of errors raised by each control on the page on a specific spot or in a message box.

153.
How do you indentify that the page is post back?

By checking the IsPostBack property. If IsPostBack is True, the page has been posted back.

154.
what are the types of ASP Objects?

There are various types of Asp objects

§  Session Object
§  Application Object
§  Server Object
§  Request Object
§  Request Object
§  Response Object
§  Object Context
§  Error Object

155.
What are remotable objects in .NET Remoting?

Remotable objects are the objects that can be marshaled across the application domains. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.

156.
What is the difference between ASP Session and ASP.NET Session?

Asp.net session supports cookie less session & it can span across multiple servers.
1.
What is C#?

§  C# (pronounced "C sharp") is a simple, modern, object-oriented, and type-safe programming language.
§  It will immediately be familiar to C and C++ programmers.
§  C# combines the high productivity of Rapid Application Development (RAD) languages.

2.
What are the types of comment in C#?

There are 3 types of comments in C#.
§  Single line (//)
§  Multi (/* */)
§  Page/XML Comments (///).

3.
What are the namespaces used in C#.NET?

Namespace is a logical grouping of class.
§  using System;
§  using System.Collections.Generic;
§  using System.Windows.Forms;

4.
What are the characteristics of C#?

There are several characteristics of C# are :
§  Simple
§  Type safe
§  Flexible
§  Object oriented
§  Compatible
§  Consistent
§  Interoperable
§  Modern

5.
How does C# differ from C++?

§  C# does not support #include statement. It uses only using statement.
§  In C# , class definition does not use a semicolon at the end.
§  C# does not support multiple code inheritance.
§  Casting in C# is much safer than in c++.
§  In C# switch can also be used on string values.
§  Command line parameters array behave differently in C# as compared to C++.
6.
What are the basic concepts of object oriented programming?

It is necessary to understand some of the concepts used extensively in object oriented programming.These include
§  Objects
§  Classes
§  Data abstraction and encapsulation
§  Inheritance
§  Polymorphism
§  Dynamic Binding
§  Message passing.

7.
Can you inherit multiple interfaces?

Yes. Multiple interfaces may be inherited in C#.

8.
What is inheritance?

Inheritance is deriving the new class from the already existing one.

9.
Define scope?

Scope refers to the region of code in which a variable may be accessed.

10.
What is the difference between public, static and void?

§  public :The keyword public is an access modifier that tells the C# compiler that the Main method is accessible by anyone.
§  static :The keyword static declares that the Main method is a global one and can be called without creating an instance of the class. The compiler stores the address of the method as the entry point and uses this information to begin execution before any objects are created.
§  void : The keyword void is a type modifier that states that the Main method does not return any value.
11.
What are the modifiers in C#?

§  Abstract
§  Sealed
§  Virtual
§  Const
§  Event
§  Extern
§  Override
§  Readonly
§  Static
§  New

12.
What are the types of access modifiers in C#?

Access modifiers in C# are :
§  public
§  protect
§  private
§  internal
§  internal protect

13.
What is boxing and unboxing?

Implicit conversion of value type to reference type of a variable is known as BOXING, for example integer to object type conversion.
Conversion of reference type variable back to value type is called as UnBoxing.

14.
What is object?

An object is an instance of a class. An object is created by using operator new. A class that creates an object in memory will contain the information about the values and behaviours (or methods) of that specific object.

15.
Where are the types of arrays in C#?

§  Single-Dimensional
§  Multidimensional
§  Jagged array
16.
What is the difference between Object and Instance?

An instance of a user-defined type is called an object. We can instantiate many objects from one class.
An object is an instance of a class.

17.
Define destuctors?

A destructor is called for a class object when that object passes out of scope or is explicitly deleted.A destructors as the name implies is used to destroy the objects that have been created by a constructors.Like a constructor , the destructor is a member function whose name is the same as the class name but is precided by a tilde.

18.
What is the use of enumerated data type?

An enumerated data type is another user defined type which provides a way for attaching names to numbers thereby increasing comprehensibility of the code. The enum keyword automatically enumerates a list of words by assigning them values 0,1,2, and so on.

19.
Define Constructors?

A constructor is a member function with the same name as its class. The constructor is invoked whenever an object of its associated class is created.It is called constructor because it constructs the values of data members of the class.

20.
What is encapsulation?

The wrapping up of data and functions into a single unit (called class) is known as encapsulation. Encapsulation containing and hiding information about an object, such as internal data structures and code.
21.
Does c# support multiple inheritance?

No,its impossible which accepts multi level inheritance.

22.
What is ENUM?

Enum are used to define constants.

23.
What is a data set?

A DataSet is an in memory representation of data loaded from any data source.

24.
What is the difference between private and public keyword?

§  Private : The private keyword is the default access level and most restrictive among all other access levels. It gives least permission to a type or type member. A private member is accessible only within the body of the class in which it is declared.
§  Public : The public keyword is most liberal among all access levels, with no restrictions to access what so ever. A public member is accessible not only from within, but also from outside, and gives free access to any member declared within the body or outside the body.

25.
Define polymorphism?

Polymorphism means one name, multiple forms. It allows us to have more than one function with the same name in a program.It allows us to have overloading of operators so that an operation can exhibit different behaviours in different instances.
26.
What is Jagged Arrays?

§  A jagged array is an array whose elements are arrays.
§  The elements of a jagged array can be of different dimensions and sizes.
§  A jagged array is sometimes called an array–of–arrays.

27.
what is an abstract base class?

An abstract class is a class that is designed to be specifically used as a base class. An abstract class contains at least one pure virtual function.

28.
How is method overriding different from method overloading?

When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same name within the class.

29.
What is the difference between ref & out parameters?

An argument passed to a ref parameter must first be initialized. Compare this to an out parameter, whose argument does not have to be explicitly initialized before being passed to an out parameter.

30.
What is the use of using statement in C#?

The using statement is used to obtain a resource, execute a statement, and then dispose of that resource.
31.
What is serialization?

Serialization is the process of converting an object into a stream of bytes.
De-serialization is the opposite process of creating an object from a stream of bytes.
Serialization / De-serialization is mostly used to transport objects.

32.
What are the difference between Structure and Class?

§  Structures are value type and Classes are reference type
§  Structures can not have contractors or destructors.
§  Classes can have both contractors and destructors.
§  Structures do not support Inheritance, while Classes support Inheritance.

33.
What is difference between Class And Interface?

Class : is logical representation of object. It is collection of data and related sub procedures with defination.
Interface : is also a class containg methods which is not having any definations.Class does not support multiple inheritance. But interface can support.

34.
What is Delegates?

Delegates are a type-safe, object-oriented implementation of function pointers and are used in many situations where a component needs to call back to the component that is using it.

35.
What is Authentication and Authorization?

Authentication is the process of identifying users. Authentication is identifying/validating the user against the credentials (username and password).
Authorization performs after authentication. Authorization is the process of granting access to those users based on identity. Authorization allowing access of specific resource to user.
36.
What is a base class?

A class declaration may specify a base class by following the class name with a colon and the name of the base class. omitting a base class specification is the same as deriving from type object.

37.
Can “this” be used within a static method?

No ‘This’ cannot be used in a static method. As only static variables/methods can be used in a static method.

38.
What is difference between constants, readonly and, static ?

§  Constants: The value can’t be changed.
§  Read-only: The value will be initialized only once from the constructor of the class.
§  Static: Value can be initialized once.

39.
What are the different types of statements supported in C#?

C# supports several different kinds of statements are
§  Block statements
§  Declaration statements
§  Expression statements
§  Selection statements
§  Iteration statements
§  Jump statements
§  Try catch statements
§  Checked and unchecked
§  Lock statement

40.
What is an interface class?

It is an abstract class with public abstract methods all of which must be implemented in the inherited classes.
41.
what are value types and reference types?

Value types are stored in the Stack.
Examples :bool, byte, chat, decimal, double, enum , float, int, long, sbyte, short, strut, uint, ulong, ushort.

Reference types are stored in the Heap.
Examples : class, delegate, interface, object, string.

42.
What is the difference between string keyword and System.String class?

String keyword is an alias for Syste.String class. Therefore, System.String and string keyword are the same, and you can use whichever naming convention you prefer. The String class provides many methods for safely creating, manipulating, and comparing strings.

43.
What are the two data types available in C#?

§  Value type
§  Reference type

44.
What are the different types of Caching?

There are three types of Caching :
§  Output Caching: stores the responses from an asp.net page.
§  Fragment Caching: Only caches/stores the portion of page (User Control)
§  Data Caching: is Programmatic way to Cache objects for performance.

45.
What is the difference between Custom Control and User Control?

Custom Controls are compiled code (Dlls), easier to use, difficult to create, and can be placed in toolbox. Drag and Drop controls. Attributes can be set visually at design time. Can be used by Multiple Applications (If Shared Dlls), Even if Private can copy to bin directory of web application add reference and use. Normally designed to provide common functionality independent of consuming Application.

User Controls are similar to those of ASP include files, easy to create, can not be placed in the toolbox and dragged - dropped from it. A User Control is shared among the single application files.
46.
What is methods?

A method is a member that implements a computation or action that can be performed by an object or class. Static methods are accessed through the class. Instance methods are accessed through instances of the class.

47.
What is fields?

A field is a variable that is associated with a class or with an instance of a class.

48.
What is events?

An event is a member that enables a class or object to provide notifications. An event is declared like a field except that the declaration includes an event keyword and the type must be a delegate type.

49.
What is literals and their types?

Literals are value constants assigned to variables in a program. C# supports several types of literals are
§  Integer literals
§  Real literals
§  Boolean literals
§  Single character literals
§  String literals
§  Backslash character literals

50.
What is the difference between value type and reference type?

§  Value types are stored on the stack and when a value of a variable is assigned to another variable.
§  Reference types are stored on the heap, and when an assignment between two reference variables occurs.
51.
What are the features of c#?

§  C# is a simple and powerful programming language for writing enterprise edition applications.
§  This is a hybrid of C++ and VB. It retains many C++ features in the area statements,expressions, and operators and incorporated the productivity of VB.
§  C# helps the developers to easily build the web services that can be used across the Internet through any language, on any platform.
§  C# helps the developers accomplishing with fewer lines of code that will lead to the fewer errors in the code.
§  C# introduces the considerable improvement and innovations in areas such as type safety,versioning. events and garbage collections.

52.
What are the types of errors?

§  Syntax error
§  Logic error
§  Runtime error

53.
What is the difference between break and continue statement?

The break statement is used to terminate the current enclosing loop or conditional statements in which it appears. We have already used the break statement to come out of switch statements.
The continue statement is used to alter the sequence of execution. Instead of coming out of the loop like the break statement did, the continue statement stops the current iteration and simply returns control back to the top of the loop.

54.
Define namespace?

The namespace are known as containers which will be used to organize the hierarchical set of .Net classes.

55.
What is a code group?

A code group is a set of assemblies that share a security context.
56.
What are sealed classes in C#?

The sealed modifier is used to prevent derivation from a class. A compile-time error occurs if a sealed class is specified as the base class of another class.

57.
What is the difference between static and instance methods?

A method declared with a static modifier is a static method. A static method does not operate on a specific instance and can only access static members.

A method declared without a static modifier is an instance method. An instance method operates on a specific instance and can access both static and instance members. The instance on which an instance method was invoked can be explicitly accessed as this. It is an error to refer to this in a static method.

58.
What are the different types of variables in C#?

Different types of variables used in C# are :
§  static variables
§  instance variable
§  value parameters
§  reference parameters
§  array elements
§  output parameters
§  local variables

59.
What is meant by method overloading?

Method overloading permits multiple methods in the same class to have the same name as long as they have unique signatures. When compiling an invocation of an overloaded method, the compiler uses overload resolution to determine the specific method to invoke

60.
What is parameters?

Parameters are used to pass values or variable references to methods. The parameters of a method get their actual values from the arguments that are specified when the method is invoked. There are four kinds of parameters: value parameters, reference parameters, output parameters, and parameter arrays.
61.
Is C# is object oriented?

YEs, C# is an OO langauge in the tradition of Java and C++.

62.
What is the difference between Array and Arraylist?

An array is a collection of the same type. The size of the array is fixed in its declaration. A linked list is similar to an array but it doesn’t have a limited size.

63.
What are the special operators in C#?

C# supports the following special operators.
§  is (relational operator)
§  as (relational operator)
§  typeof (type operator)
§  sizeof (size operator)
§  new (object creator)
§  .dot (member access operator)
§  checked (overflow checking)
§  unchecked (prevention of overflow checking)

64.
What is meant by operators in c#?

An operator is a member that defines the meaning of applying a particular expression operator to instances of a class. Three kinds of operators can be defined: unary operators, binary operators, and conversion operators. All operators must be declared as public and static.

65.
What is a parameterized type?

A parameterized type is a type that is parameterized over another value or type
66.
What are the features of abstract class?

§  An abstract class cannot be instantiated, and it is an error to use the new operator on an abstract class.
§  An abstract class is permitted (but not required) to contain abstract methods and accessors.
§  An abstract class cannot be scaled.

67.
What is the use of abstract keyword?

The modifier abstract is a keyword used with a class, to indicate that this class cannot itself have direct instances or objects, and it is intended to be only a 'base' class to other classes.

68.
What is the use of goto statement?

The goto statement is also included in the C# language. This goto can be used to jump from inside a loop to outside. But jumping from outside to inside a loop is not allowed.

69.
What is the difference between console and window application?

§  A console application, which is designed to run at the command line with no user interface.
§  A Windows application, which is designed to run on a user’s desktop and has a user interface.

70.
What is the use of return statement?

The return statement is associated with procedures (methods or functions). On executing the return statement, the system passes the control from the called procedure to the calling procedure. This return statement is used for two purposes :
§  to return immediately to the caller of the currently executed code
§  to return some value to the caller of the currently executed code.
71.
What is the difference between Array and LinkedList?

Array is a simple sequence of numbers which are not concerned about each others positions. they are independent of each other’s positions. adding, removing or modifying any array element is very easy. Compared to arrays ,linked list is a complicated sequence of numbers.

72.
Does C# have a throws clause?

No, unlike Java, C# does not require the developer to specify the exceptions that a method can throw.

73.
Does C# support a variable number of arguments?

Yes, using the params keyword. The arguments are specified as a list of arguments of a specific type.

74.
Can you override private virtual methods?

No, private methods are not accessible outside the class.

75.
What is a multi cast delegates?

It is a delegate that points to and eventually fires off several methods.
1.
What is Ado.NET?

§  ADO.NET is an object-oriented set of libraries that allows you to interact with data sources.
§  ADO.NET is a set of classes that expose data access services to the .NET programmer.
§  ADO.NET is also a part of the .NET Framework.
§  ADO.NET is used to handle data access.

2.
What are the two fundamental objects in ADO.NET?

There are two fundamental objects in ADO.NET.
Datareader - connected architecture and
Dataset - disconnected architecture.

3.
What are the data access namespaces in .NET?

The most common data access namespaces :
§  System.Data
§  System.Data.OleDb
§  System.Data.SQLClient
§  System.Data.SQLTypes
§  System.Data.XML

4.
What are major difference between classic ADO and ADO.NET?

In ADO the in-memory representation of data is the recordset.ARecordset object is used to hold a set of records from a database table.
In ADO.NET we have dataset.ADataSet is an in memory representation of data loaded from any data source.

5.
what is the use of connection object in ado.net?

The ADO Connection Object is used to create an open connection to a data source. Through this connection, you can access and manipulate a database.

6.
What are the benefits of ADO.NET?

§  Scalability
§  Data Source Independence
§  Interoperability
§  Strongly Typed Fields
§  Performance
7.
What is a Clustered Index?

The data rows are stored in order based on the clustered index key. Data stored is in a sequence of the index. In a clustered index, the physical order of the rows in the table is the same as the logical (indexed) order of the key values. A table can contain only one clustered index. A clustered index usually provides faster access to data than does a non-clustered index.

8.
What is a Non-Clustered Index?

The data rows are not stored in any particular order, and there is no particular order to the sequence of the data pages. In a clustered index, the physical order of the rows in the table is not same as the logical (indexed) order of the key values.

9.
Whate are different types of Commands available with DataAdapter ?

The SqlDataAdapter has
§  SelectCommand
§  InsertCommand
§  DeleteCommand
§  UpdateCommand

10.
What is the difference between an ADO.NET Dataset and an ADO Recordset?

§  Dataset can fetch source data from many tables at a time, for Recordset you can achieve the same only using the SQL joins.
§  A DataSet can represent an entire relational database in memory, complete with tables, relations, and views, A Recordsetcan not.
§  A DataSet is designed to work without any continues connection to the original data source; Recordset maintains continues connection with the original data source.
§  DataSets have no current record pointer, you can use For Each loops to move through the data. Recordsets have pointers to move through them.

11.
Which method do you invoke on the DataAdapter control to load your generated dataset with data?

DataAdapter’ fill () method is used to fill load the data in dataset.

12.
What are the different methods available under sqlcommand class to access the data?

§  ExecuteReader - Used where one or more records are returned - SELECT Query.
§  ExecuteNonQuery - Used where it affects a state of the table and no data is being queried - INSERT, UPDATE, DELETE, CREATE and SET queries.
§  ExecuteScalar - Used where it returns a single record.
13.
What is a DataSet?

A DataSet is an in memory representation of data loaded from any data source.

14.
What is a DataTable?

A DataTable is a class in .NET Framework and in simple words a DataTable object represents a table from a database.

15.
What is the data provider name to connect to Access database?

Microsoft.Access

16.
Which namespaces are used for data access?

§  System.Data
§  System.Data.OleDB
§  System.Data.SQLClient

17.
What is difference between Dataset.clone and Dataset.copy?

Clone: - It only copies structure, does not copy data.
Copy: - Copies both structure and data.

18.
What is difference between dataset and datareader?

§  DataReader provides forward-only and read-only access to data, while the DataSet object can hold more than one table (in other words more than one rowset) from the same data source as well as the relationships between them.
§  Dataset is a disconnected architecture while datareader is connected architecture.
§  Dataset can persist contents while datareadercan not persist contents, they are forward only.
19.
What is DataAdapter?

A data adapter represents a set of methods used to perform a two-way data updating mechanism between a disconnected DataTable and the database. It aggregates four commands: select, update, insert and delete command. One adapter can only generate and fill one table in a DataSet.

20.
What is a Command Object?

The ADO Command object is used to execute a single query against a database. The query can perform actions like creating, adding, retrieving, deleting or updating records.

21.
What is basic use of DataView?

“DataView” represents a complete table or can be small section of rows depending on some criteria. It is best used for sorting and finding data with in “datatable”.

22.
What is the use of Connection Object?

The ADO Connection Object is used to create an open connection to a data source. Through this connection, you can access and manipulate a database.

23.
What are the advantage of ADO.Net?

§  Database Interactions Are Performed Using Data Commands
§  Data Can Be Cached in Datasets
§  Datasets Are Independent of Data Sources
§  Data Is Persisted as XML.

24.
What is a stored procedure?

A stored procedure is a precompiled executable object that contains one or more SQL statements.
A stored procedure may be written to accept inputs and return output
25.
What is the difference between OLEDB Provider and SqlClient ?

SQLClient .NET classes are highly optimized for the .net / sqlserver combination and achieve optimal results. The SqlClient data provider is fast. It's faster than the Oracle provider, and faster than accessing database via the OleDb layer.

26.
What is the use of Parameter Object?

In ADO Parameter object provides information about a single parameter used in a stored procedure or query.

27.
What is DataAdapter?

DataSet contains the data from the DataAdapter which is the bridge between the DataSet and Database. DataAdapter provides the way to retrieve and save data between the DataSet and Database. It accomplishes this by means of request to the SQL Commands made against the database.

28.
What does ADO mean?

ADO stands for ActiceX Data Objects.It was introduced few years ago as a solution to accessing data that can be found in various forms, not only over a LAN but over the internet. It replaced the data access technologies RDO(Remote Data Objects) and DAO (Data Access Objects).

29.
Name some ADO.NET Objects?

§  Connection Object
§  DataReader Object
§  Command Object
§  DataSet Object
§  DataAdapter Object

30.
What is Data Provider?

A set of libraries that is used to communicate with data source. Eg: SQL data provider for SQL, Oracle data provider for Oracle, OLE DB data provider for access, excel or mysql.
31.
What is the DataTableCollection?

An ADO.NET DataSet contains a collection of zero or more tables represented by DataTable objects. The DataTableCollection contains all the DataTable objects in a DataSet.

32.
What are the benefits of ADO.NET?

ADO.NET offers several advantages over previous versions of ADO and over other data access components. These benefits fall into the following categories:
§  Interoperability
§  Maintainability
§  Programmability
§  Performance
§  Scalability

33.
How to creating a SqlConnection Object?

SqlConnection conn = new SqlConnection("Data Source=DatabaseServer;Initial Catalog=Northwind;User ID=YourUserID;Password=YourPassword");

34.
How to creating a SqlCommand Object?

It takes a string parameter that holds the command you want to execute and a reference to a SqlConnection object.
SqlCommandcmd = new SqlCommand("select CategoryName from Categories", conn);

35.
How to load multiple tables into dataset?

SqlDataAdapter da = new SqlDataAdapter("Select * from Id; Select * from Salry", mycon);
da.Fill(ds);
ds.Tables[0].TableName = "Id";
ds.Tables[1].TableName = "Salary";

36.
What is the provider and namespaces being used to access oracle database?

system.data.oledb
37.
What is the difference between SqlCommand and SqlCommandBuilder?

SQLCommand is used to retrieve or update the data from database.
SQLCommandBuilder object is used to build & execute SQL (DML) queries like select insert update& delete.

38.
What is the use of SqlCommandBuilder?

SQL CommandBuilder object is used to build & execute SQL (DML) queries like select insert update& delete.

39.
What are managed providers?

A managed provider is analogous to ODBC driver or OLEDB provider. It performs operation of communicating with the database. ADO.NET currently provides two distinct managed providers. The SQL Server managed provider is used with SQL server and is a very efficient way of communicating with SQL Server. OLEDB managed provider is used to communicate with any OLEDB compliant database like Access or Oracle.

40.
How do I delete a row from a DataTable?

ds.Tables("data_table_name").Rows(i).Delete
dscmd.update(ds,"data_table_name")

41.
What inside in DataSet?

Inside DataSet much like in Database, there are tables, columns, constraints, relationships, views and so forth.

42.
Explain ADO.Net Architecture?

ADO.NET provides the efficient way to manipulate the database. It contains the following major components. 1. DataSet Object 2. Data Providers :
§  Connection Object
§  Command Object
§  DataReader Object
§  DataAdapter Object.
43.
What is the difference between int and int32?

Both are same. System.Int32 is a .NET class. Int is an alias name for System.Int32.

44.
What is the role of the DataReader class in ADO.NET connections?

It returns a read-only, forward-only rowset from the data source. A DataReader provides fast access when a forward-only sequential read is needed.

45.
What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?

SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix. OLE-DB.NET is a .NET layer on top of the OLE layer, so it’s not as fastest and efficient as SqlServer.NET.

46.
What are acid properties?

§  Atomicity
§  Consistency
§  Isolation
§  Durability

47.
What is DataRowCollection?

Similar to DataTableCollection, to represent each row in each Table we have DataRowCollection.

48.
What is the use of Ado.net connection?

Establishes a connection to a specific data source.
49.
What are basic methods of Dataadapter?

§  Fill
§  FillSchema
§  Update

50.
What are the various methods provided by the dataset object to generate XML?

ReadXML : Read’s a XML document in to Dataset.
GetXML : This is a function which returns the string containing XML document.
WriteXML : This writes a XML data to disk.

51.
What is DataSet Object?

Dataset is a disconnected, in-memory representation of data. It can contain multiple data table from different database.

52.
What is difference between Optimistic and Pessimistic locking?

In Pessimistic locking when user wants to update data it locks the record and till then no one can update data. Other user’s can only view the data when there is pessimistic locking
In Optimistic locking multiple users can open the same record for updating, thus increase maximum concurrency. Record is only locked when updating the record.
53.
What is Execute Non Query?

The ExecuteNonQuery() is one of the most frequently used method in SqlCommand Object, and is used for executing statements that do not return result sets (ie. statements like insert data , update data etc.).

54.
What providers does Ado.net uses?

The .NET Framework provides mainly three data providers, they are Microsoft SQL Server, OLEDB, ODBC.
1.
Define SQL?

Structured query language is the standard command set used to communicate with the relational database management system.

2.
Define Dbms?

A Database Management system consists of a collection of interrelated data and set of programs to access that data.

3.
What is the purpose of Database systems?

A Database Management system provides a secure and survivable medium for the storage and retrieval of data.In the real world, the data is shared among several users and is persistent.

4.
State the different between Security and Integrity?

Security is a protection from malicious attempts to steal or modify data.

Integrity constraints guard against accidental damage to the database, by ensuribg that authorized changes to the database do not result in a loss of data consistency.

5.
Define Normalisation?

Normalisation is an essential part of database design. A good understanding of the semantic of data helps the designer to built efficient design using the concept of normalization.

6.
What are the purpose of Normalisation?

§  Minimize redundancy in data.
§  Remove insert, delete and update anamoly during the database activities.
§  Reduce the need to reorganize data it is modified or enhanced.
7.
Define Primary Key?

§  The primary key is the columns used to uniquely identify each row of a table.
§  A table can have only one primary key.
§  No primary key value can appear in more than one row in the table.

8.
Define Unique Key?

Unique key is a one or more column that must be unique for each row of the table.
It is similar to primary key. Primary key column will not accept a null. Whereas the unique key column will accept a null values.

9.
Define Foreign Key?

A foreign Key is a combination of columns with value is based on the primary key values from another table. A foreign key constraint also known as Referential Integrity Constraint.

10.
Define View?

§  A View is a database object that is a logical representation of a table.
§  It is derived from a table but has no longer of its own and often may be used in the same manner as a table.
§  A view is a virtual table that has columns similar to a table.
§  A view does not represent any physical data.

11.
Compare and contrast TRUNCATE and DELETE for a table?

Both the truncate and delete command have the desired outcome of getting rid of all the rows in a table. The difference between the two is that the truncate command is a DDL operation and just moves the high water mark and produces a now rollback. The delete command, on the other hand, is a DML operation, which will produce a rollback and thus take longer to complete.

12.
What is cursors?

Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time.
13.
Define SubQuery?

§  Nesting of Queries one within the other is called as a Subquery.
§  A table can have only one primary key.

14.
What are the different types of subquery?

§  Single row subquery
§  Multiple row subquery
§  Correlated row subquery

15.
What are the different types of replication?

The SQL Server 2000-supported replication types are as follows
§  Transactional
§  Snapshot
§  Merge

16.
What is User Defined Functions?

User-Defined Functions allow to define its own T-SQL functions that can accept 0 or more parameters and return a single scalar data value or a table data type.

17.
Define Self Join?

Self join means joining one table with itself.
The self join can be viewed as a join of two copies of the same table.

18.
Define Sequence?

A Sequence is a database object that can be used to provide very quick generation of unique numbers.
19.
Define Joins?

A Join combines columns and data from two or more tables (and in rare cases, of one table with itself).

20.
What are the types of Joins?

§  Equi joins
§  Cartesian Joins
§  Outer Joins
§  Self Joins.

21.
Define Equi Joins?

AEqui Join is a join in which the join comparison operator is an equality. When two tables are joined together using equality or values in one or more columns, they make an Equi Join.

22.
Define Cartesian Join?

Joining two tables without a whereclause produces a Cartesian join which combines every row in one table with every row in another table.

23.
What are three SQL keywords used to change or set someone's permissions?

GRANT, DENY, and REVOKE

24.
What are primary keys and foreign keys?

Primary keys are the unique identifiers for each row. They must contain unique values and cannot be null. Due to their importance in relational databases, Primary keys are the most fundamental of all keys and constraints. A table can have only one Primary key.

Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables.
25.
Define data model?

Underlying the structure of the database is called as data model.

26.
What is an Entity?

It is a 'thing' in the real world with an independent existence.

27.
What is BCP? When does it used?

BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination.

28.
Explain the use of the by GROUP BY and the HAVING clause?

The GROUP BY partitions the selected rows on the distinct values of the column on which the group by has been done.
The HAVING selects groups which match the criteria specified.

29.
What is DataWarehousing?

According to Bill Inmon, known as father of Data warehousing. “A Data warehouse is a subject oriented, integrated ,time variant, non volatile collection of data in support of management’s decision making process”.

30.
What are the advantages of Database?

§  Redundancy can be reduced
§  Inconsistence can be avoided
§  The data can be shared
§  Standards can be enforced
§  Security can be enforced
§  Integrity can be maintained
31.
What are the advantage of SQL?

The advantages of SQL are
§  SQL is a high level language that provides a greater degree of abstraction than procedural languages.
§  SQL enables the end users and system personnel to deal with a number of Database management systems where it is available.
§  Application written in SQL can be easily ported across systems.

32.
What is the difference between join and outer join?

Outer joins return all rows from at least one of the tables or views mentioned in the FROM clause, as long as those rows meet any WHERE or HAVING search conditions.

join combines columns and data from two are more tables.

33.
Define Boyce coded normal form?

A relation is said to be in Boyce coded normal form if it is already in the third normal form and every determine is a candidate key.

34.
What are the transaction properties?

§  Atomicity
§  Consistency
§  Isolation
§  Durability

35.
What is data mining?

Data mining refers to using variety of techniques to identify nuggests of information or decision making knowledge in bodies of data and extracting these in such a way that they can be put in the use in the areas such as decision support, predication, forecasting and estimation.

36.
Compare DBMS versus object oriented DBMS?

DBMS consists of a collection of interrelated data and a set of programs to access that data.
The object oriented DBMS is one of the type of dbms in which information is stored in the form of objects
37.
What are the types of SQL Commands?

§  Data Definition Language (DDL)
§  Data Manipulation Language (DML)
§  Data Query Language (DQL)
§  Data Control Language (DCL)

38.
What is an attribute?

An entity is represented by a set of attributes.
Attributes are descriptive properties possessed by each member of an entity set.
There are different types of attributes.
§  Simple
§  Composite
§  Single-valued
§  Derived

39.
What are the different types of data models ?

§  Entity relationship model
§  Relational model
§  Hierarchical model
§  Network model
§  Object oriented model
§  Object relational model

40.
What is an active database?

Active database is a database that includes active rules, mostly in the form of ECA rules(Event Condition rules).
Active database systems enhance traditional database functionality with powerful rule processing cabalities, providing a uniform and efficient mechanism for database system applications.

41.
What are ACID properties?



§  Atomicity
§  Consistency
§  Isolation
§  Durability

42.
Define Self Join?

Self join means joining one table with itself.
The self join can be viewed as a join of two copies of the same table.
43.
What is a tuple?

A tuple is an instance of data within a relational database.

44.
What is meant by embedded SQL?

They are SQL statements that are embedded with in application program and are prepared during the program preparation process before the program is executed. After it is prepared, the statement itself does not change(although values of host variables specified within the statement might change).

45.
What is Functional Dependency?

A Functional dependency is denoted by X Y between two sets of attributes X and Y that are subsets of R specifies a constraint on the possible tuple that can form a relation state r of R. The constraint is for any two tuples t1 and t2 in r if t1[X] = t2[X] then they have t1[Y] = t2[Y]. This means the value of X component of a tuple uniquely determines the value of component Y.

46.
What are the different phases of transaction?

The different phases of transaction are
§  Analysis phase
§  Redo Phase
§  Undo phase

47.
What the difference between UNION and UNIONALL?

Union will remove the duplicate rows from the result set while Union all does’nt.

48.
What is diffrence between Co-related sub query and nested sub query?

Correlated subquery runs once for each row selected by the outer query. It contains a reference to a value from the row selected by the outer query.

Nested subquery runs only once for the entire nesting (outer) query. It does not contain any reference to the outer query row.
49.
What is the use of DBCC commands?

DBCC stands for database consistency checker. We use these commands to check the consistency of the databases, i.e., maintenance, validation task and status checks.

50.
What is a Linked Server?

Linked Servers is a concept in SQL Server by which we can add other SQL Server to a Group and query both the SQL Server dbs using T-SQL Statements. With a linked server, you can create very clean, easy to follow, SQL statements that allow remote data to be retrieved, joined and combined with local data.

51.
What is Collation?

Collation refers to a set of rules that determine how data is sorted and compared. Character data is sorted using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types and character width.

52.
What are different type of Collation Sensitivity?

The different phases of transaction are
§  Case sensitivity
§  Accent sensitivity
§  Kana Sensitivity
§  Width sensitivity

53.
What is the difference between a primary key and a unique key?

Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn’t allow NULLs, but unique key allows one NULL only.

54.
What is the difference between Function and Stored Procedure?

§  UDF can be used in the SQL statements anywhere in the WHERE / HAVING / SELECT section where as Stored procedures cannot be.
§  UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
§  Inline UDF’s can be though of as views that take parameters and can be used in JOINs and other Rowset operations.
55.
What command do we use to rename a db?

sp_renamedb “oldname” , “newname”
If someone is using db it will not accept sp_renmaedb. In that case first bring db to single user using sp_dboptions. Use sp_renamedb to rename database. Use sp_dboptions to bring database to multi user mode.

56.
What is BCP?

BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination.

57.
What is Cross Join?

A cross join that does not have a WHERE clause produces the Cartesian product of the tables involved in the join. The size of a Cartesian product result set is the number of rows in the first table multiplied by the number of rows in the second table.

58.
What is Storage Manager?

It is a program module that provides the interface between the low-level data stored in database, application programs and queries submitted to the system.

59.
What are stored-procedures? And what are the advantages of using them?

Stored procedures are database objects that perform a user defined operation. A stored procedure can have a set of compound SQL statements. A stored procedure executes the SQL commands and returns the result to the client. Stored procedures are used to reduce network traffic.

60.
What is database Trigger?

A database trigger is a PL/SQL block that can defined to automatically execute for insert, update, and delete statements against a table. The trigger can e defined to execute once for the entire statement or once for every row that is inserted, updated, or deleted.
61.
What is OLTP?

Online Transaction Processing (OLTP) relational databases are optimal for managing changing data. When several users are performing transactions at the same time, OLTP databases are designed to let transactional applications write only the data needed to handle a single transaction as quickly as possible.

62.
What is DDL (Data Definition Language)?

A data base schema is specifies by a set of definitions expressed by a special language called DDL.

63.
What is Weak Entity set?

An entity set may not have sufficient attributes to form a primary key, and its primary key compromises of its partial key and primary key of its parent entity, then it is said to be Weak Entity set.

64.
What is a deadlock?

Two processes wating to update the rows of a table which are locked by the other process then deadlock arises.

65.
What do you mean by flat file database?

It is a database in which there are no programs or user access languages. It has no cross-file capabilities but is user-friendly and provides user-interface management.

66.
What is Storage Manager?

It is a program module that provides the interface between the low-level data stored in database, application programs and queries submitted to the system.
67.
What is Index?

An index is a physical structure containing pointers to the data. Indices are created in an existing table to locate rows more quickly and efficiently. It is possible to create an index on one or more columns of a table, and each index is given a name.

68.
What is the difference between clustered and a non-clustered index?

Clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages.

Nonclustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf node of a nonclustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.

69.
What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?

HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is basically used only with the GROUP BY function in a query. WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.

70.
What is log shipping?

Log shipping is the process of automating the backup of database and transaction log files on a production SQL server, and then restoring them onto a standby server. Enterprise Editions only supports log shipping. In log shipping the transactional log file from one server is automatically updated into the backup database on the other server.

71.
What are primary keys and foreign keys?

Primary keys are the unique identifiers for each row. They must contain unique values and cannot be null. Due to their importance in relational databases, Primary keys are the most fundamental of all keys and constraints. A table can have only one Primary key.
Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables.

72.
What are check constraint?

Check constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity.

96.
What is Self Join?

A self join can be of any type, as long as the joined tables are the same. A self join is rather unique in that it involves a relationship with only one table.
3.
What are the type of Synonyms?

There are two types of Synonyms are :
§  Private
§  Public

74.
What is an Integrity Constrains?

An integrity constraint is a declarative way to define a business rule for a column of a table.

75.
What is Table?

A table is the basic unit of data storage in an ORACLE database. The tables of a database hold all of the user accessible data. Table data is stored in rows and columns.

76.
What is a synonym?

A synonym is an alias for a table, view, sequence or program unit.

77.
What is Rollback Segment?

A Database contains one or more Rollback Segments to temporarily store "undo" information.

78.
What does COMMIT do?

Commit makes permanent the changes resulting from all SQL statements in the transaction. The changes made by the SQL statements of a transaction become visible to other user sessions transactions that start only after transaction is committed.
79.
What is a Database instance?

A database instance (Server) is a set of memory structure and background processes that access a set of database files.

80.
What are Roles?

Roles are named groups of related privileges that are granted to users or other roles.

81.
What is SQLPlus?

SQLPlus is an application that recognizes & executes SQL commands & specialized SQL*Plus commands that can customize reports, provide help & edit facility & maintain system variables.

82.
What is the difference between normalization and denormalization?

Normalizing data means eliminating redundant information from a table and organizing the data so that future changes to the table are easier.

Denormalization means allowing redundancy in a table. The main benefit of denormalization is improved performance with simplified data retrieval and manipulation.

83.
What is a trigger?

Triggers are stored procedures created in order to enforce integrity rules in a database. A trigger is executed every time a data-modification operation occurs (i.e., insert, update or delete).
Triggers are executed automatically on occurance of one of the data-modification operations.

84.
What is the difference between static and dynamic SQL?

Static SQL is hard-coded in a program when the programmer knows the statements to be executed.
Dynamic SQL the program must dynamically allocate memory to receive the query results.
85.
What is UNIQUE KEY constraint?

A UNIQUE constraint enforces the uniqueness of the values in a set of columns, so no duplicate values are entered. The unique key constraints are used to enforce entity integrity as the primary key constraints.

86.
What is NOT NULL Constraint?

A NOT NULL constraint enforces that the column will not accept null values. The not null constraints are used to enforce domain integrity, as the check constraints.

87.
What is meant by query optimization?

The phase that identifies an efficient execution plan for evaluating a query that has the least estimated cost is referred to as query optimization.

88.
What is meant by embedded SQL?

They are SQL statements that are embedded with in application program and are prepared during the program preparation process before the program is executed.

89.
What is File Manager?

It is a program module, which manages the allocation of space on disk storage and data structure used to represent information stored on a disk.

90.
Define transaction?

A collection of operations that fom a single logical unit of works are called transaction.
91.
Define Constraints?

Constraints is a rule or restriction concerning a piece of data that is enforced at the data level.
A Constraint clause can constrain a single column or group of columns in a table.
There are five types of Constraint namely
§  Null / Not Null
§  Primary Key
§  Unique
§  Check or Validation
§  Foreign Key or References Key

92.
What are types of sub-queries?

§  Single-row subquery, where the subquery returns only one row.
§  Multiple-row subquery, where the subquery returns multiple rows.
§  Multiple column subquery, where the subquery returns multiple columns.

93.
What is SQL Profiler?

SQL Profiler is a graphical tool that allows system administrators to monitor events in an instance of Microsoft SQL Server. You can capture and save data about each event to a file or SQL Server table to analyze later.

94.
Define Clusters?

Clustering is a method of storing tables that are intimately related and often joined together into the same area on disk.
A cluster contains one or more tables, which have one or more column in common among them.

95.
Define Indexes?

Index is a general term for an Oracle/SQL features used to primarily to speed execution and imposes uniqueness upon certain data.
The most important of an index is to ensure uniqueness of rows and help in speedy retrieval of data.

96.
What is data integrity?

Data integrity is an important feature in SQL Server. When used properly, it ensures that data is accurate, correct, and valid. It also acts as a trap for otherwise undetectable bugs within applications.
97.
What is De-normalization?

De-normalization is the process of attempting to optimize the performance of a database by adding redundant data.
De-normalization is a technique to move from higher to lower normal forms of database modeling in order to speed up database access.

98.
What is referential integrity?

Referential integrity refers to the consistency that must be maintained between primary and foreign keys, i.e. every foreign key value must have a corresponding primary key value.

99.
What is the difference between static and dynamic SQL?

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.

100.
Define Unique Key?

Unique key is a one or more column that must be unique for each row of the table.
It is similar to primary key. Primary key column will not accept a null. Whereas the unique key column will accept a null values.

101.
Define Synonym?

Synonym is an alternative method to creating a view that includes the entire table or view from another user it to create a synonym.
A synonym is a name assigned to a table or view that may thereafter be used to refer to it.
102.
What is an Data Abtration?

A major purpose of a database system is to provide users with an abstract view of the data.There are three levels of data abstraction
§  Physical level
§  Logical level
§  View level

103.
What is Transaction Manager?

It is a program module, which ensures that database, remains in a consistent state despite system failures and concurrent transaction execution proceeds without conflicting.

104.
What kind of User-Defined Functions can be created?

There are three types of User-Defined functions in SQL Server 2000 and they are Scalar, Inline Table-Valued and Multi-statement Table-valued.

105.
What are defaults? Is there a column to which a default can't be bound?

A default is a value that will be used by a column, if no value is supplied to that column while inserting data. IDENTITY columns and timestamp columns can't have defaults bound to them. See CREATE DEFUALT in books online.
106.
What's the maximum size of a row?

8060 bytes. Don't be surprised with questions like what is the maximum number of columns per table. Check out SQL Server books online for the page titled: “Maximum Capacity Specifications”.

107.
What is the difference between a local and a global variable?

Local temporary table exists only for the duration of a connection or, if defined inside a compound statement, for the duration of the compound statement.
Global temporary table remains in the database permanently, but the rows exist only within a given connection. When connection are closed, the data in the global temporary table disappears. However, the table definition remains with the database for access when database is opened next time.

108.
What is a query?

A query with respect to DBMS relates to user commands that are used to interact with a data base. The query language can be classified into data definition language and data manipulation language.

109.
What is Relational Algebra?

It is procedural query language. It consists of a set of operations that take one or two relations as input and produce a new relation.
110.
What is the difference between TRUNCATE and DELETE commands?

TRUNCATE is a DDL command whereas DELETE is a DML command. Hence DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back. WHERE clause can be used with DELETE and not with TRUNCATE.

111.
Describe the three levels of data abstraction?

There are three levels of abstraction :

§  Physical level :
The lowest level of abstraction describes how data are stored.
§  Logical level:
The next higher level of abstraction, describes what data are stored in database and what relationship among those data.
§  View level:
The highest level of abstraction describes only part of entire database.

112.
How to copy the tables, schema and views from one SQL server to another?

Microsoft SQL Server 2000 Data Transformation Services (DTS) is a set of graphical tools and programmable objects that lets user extract, transform, and consolidate data from disparate sources into single or multiple destinations.
113.
What is the use of DESC in SQL?

DESC has two purposes.
It is used to describe a schema as well as to retrieve rows from table in descending order.

114.
What is a cluster Key?

The related columns of the tables are called the cluster key. The cluster key is indexed using a cluster index and its value is stored only once for multiple tables in the cluster.

115.
Define candidate key, alternate key, composite key?

A candidate key is one that can identify each row of a table uniquely. Generally a candidate key becomes the primary key of the table.

If the table has more than one candidate key, one of them will become the primary key, and the rest are called alternate keys.

A key formed by combining at least two or more columns is called composite key.
116.
What are the purpose of Normalisation?



§  Minimize redundancy in data.
§  Remove insert, delete and update anamoly during the database activities.
§  Reduce the need to reorganize data it is modified or enhanced.
§  Normalisation reduces a complex user view to a set of small and stable subgroups of fields or relations.

117.
What is RAID?

RAID, an acronym for Redundant Array of Independent Disks (sometimes incorrectly referred to as Redundant Array of Inexpensive Disks), is a technology that provides increased storage functions and reliability through redundancy.

118.
What is database replication?

Replication is the process of copying / moving data between databases on the same or different servers.
119.
What are cursors?

Cursors allow row-by-row prcessing of the result sets.

120.
What is a weak entity types?

The entity types that do not have key attributes of their own are called weak entity types. Rests are called strong entity types .The entity that gives identity to a weak entity is called owner entity. And the relationship is called identifying relationship. A weak entity type always has a total participation constraint with respect to its identifying relationship.

121.
What are defaults?

A default is a value that will be used by a column, if no value is supplied to that column while inserting data. IDENTITY columns and timestamp columns can’t have defaults bound to them.

122.
What is specialization?

It is the process of defining a set of subclasses of an entity type where each subclass contain all the attributes and relationships of the parent entity and may have additional attributes and relationships which are specific to itself.
122.
What are the different types of cursors?

Types of cursors :
§  Static
§  Dynamic
§  Forward-only
§  Keyset-driven

123.
What is a Catalog?

A catalog is a table that contain the information such as structure of each file ,the type and storage format of each data item and various constraints on the data .The information stored in the catalog is called Metadata . Whenever a request is made to access a particular data, the DBMS s/w refers to the catalog to determine the structure of the file.

124.
What is a view?

A view may be a subset of the database or it may contain virtual data that is derived from the database files but is not explicitly stored.

125.
What are different types of end users?

§  Casual end-users
§  Casual end-users
§  Sophisticated end users
§  Stand alone users
125.
What is a data model?

It is a collection of concepts that can be used to describe the structure of a database. It provides necessary means to achieve this abstraction. By structure of a database we mean the data types, relations, and constraints that should hold on the data.

126.
What are types of schema?

§  Internal schema
§  Conceptual schema
§  External schema

127.
What are different types of DBMS?

§  DBMS
§  RDBMS (Relational)
§  ORDBMS (Object Relational)
§  DDBMS (Distributed)
§  FDBMS (Federated)
§  FDBMS (Federated)
§  HDBMS (Hierarchical)
§  NDBMS (Networked)

128.
What is a lock?

A lock is a variable associated with a data item that describes the status of the item with respect to the possible operations that can be applied to it.
1.
What is Sql server?

SQL - Structured query language is the standard command set used to communicate with the relational database management system.

Sql server - is commonly used as the backend system for websites and corporate CRMs and can support thousands of concurrent users.SQL Server is much more robust and scalable than a desktop database management system such as Microsoft Access.

2.
What are the System Database in Sql server 2005?

§  Master - Stores system level information such as user accounts, configuration settings, and info on all other databases.
§  Model - database is used as a template for all other databases that are created
§  Msdb - Used by the SQL Server Agent for configuring alerts and scheduled jobs etc
§  Tempdb - Holds all temporary tables, temporary stored procedures, and any other temporary storage requirements generated by SQL Server.

3.
What is the difference between TRUNCATE and DELETE commands?

TRUNCATE is a DDL command whereas DELETE is a DML command. Hence DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back. WHERE clause can be used with DELETE and not with TRUNCATE.

4.
What is OLTP?

Online Transaction Processing (OLTP) relational databases are optimal for managing changing data. When several users are performing transactions at the same time, OLTP databases are designed to let transactional applications write only the data needed to handle a single transaction as quickly as possible.

5.
Define Normalisation?

Normalisation is an essential part of database design. A good understanding of the semantic of data helps the designer to built efficient design using the concept of normalization.
6.
What are the difference between clustered and a non-clustered index?

Clustered index is a special type of index that reorders the way in which each records in the table are physically stored.
Non clustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk.

7.
What are the System Database in Sql server 2008?

§  Master
§  Model
§  Msdb
§  Tempdb
§  Resource

8.
What is denormalization and when would you go for it?

Denormalization is the process of attempting to optimize the performance of a database by adding redundant data or by grouping data.Denormalization is the reverse process of normalization.

9.
What are the different types of Sub-Queries?

§  Single row subquery
§  Multiple row subquery
§  Correralted row subquery

10.
What are constraints? Explain different types of constraints?

Constraints is a rule or restriction concerning a piece of data that is enforced at the data level. A Constraint clause can constrain a single column or group of columns in a table.
There are five types of Constraint namely
§  Null / Not Null
§  Primary Key
§  Unique
§  Check or Validation
§  Foreign Key or References Key
11.
What are the different types of BACKUPs avaialabe in SQL Server 2005?

In SQL Server 2005 Backup Types are

§  Full
§  Transaction Log
§  Differential
§  Partial
§  Differential Partial
§  File and Filegroup
§  Copy Only Database Backups.

12.
What are Data files?

This is the physical storage for all of the data on disk. Pages are read into the buffer cache when users request data for viewing or modification. After data has been modified in memory (the buffer cache), it is written back to the data file during the checkpoint process.

13.
Define Primary Key?

§  The primary key is the columns used to uniquely identify each row of a table.
§  A table can have only one primary key.
§  No primary key value can appear in more than one row in the table.

14.
What is cursors? and what are the different types of cursor?

Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time.

§  Implicit cursors
§  Explicit cursors
§  Paramaeteried cursors

15.
What is SQL Profiler?

SQL Profiler is a graphical tool that allows system administrators to monitor events in an instance of Microsoft SQL Server. You can capture and save data about each event to a file or SQL Server table to analyze later.
16.
Define Unique Key?

§  Unique key is a one or more column that must be unique for each row of the table.
§  It is similar to primary key. Primary key column will not accept a null. Whereas the unique key column will accept a null values.

17.
Define Joins?

A Join combines columns and data from two or more tables (and in rare cases, of one table with itself).

18.
Define Indexes?

Index is a general term for an Oracle/SQL features used to primarily to speed execution and imposes uniqueness upon certain data.
The most important of an index is to ensure uniqueness of rows and help in speedy retrieval of data.

19.
What are the difference between primary keys and foreign keys?

The primary key is the columns used to uniquely identify each row of a table.A table can have only one primary key.
Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables.

20.
Define Clusters?

Clustering is a method of storing tables that are intimately related and often joined together into the same area on disk.
A cluster contains one or more tables, which have one or more column in common among them.
21.
What are the transaction properties?

§  Atomicity
§  Consistency
§  Isolation
§  Durability

22.
Define Synonym?

Synonym is an alternative method to creating a view that includes the entire table or view from another user it to create a synonym.
A synonym is a name assigned to a table or view that may thereafter be used to refer to it.

23.
What is an active database?

Active database is a database that includes active rules, mostly in the form of ECA rules(Event Condition rules). Active database systems enhance traditional database functionality with powerful rule processing cabalities, providing a uniform and efficient mechanism for database system applications.

24.
What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?

HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is basically used only with the GROUP BY function in a query whereas WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.

25.
What are the purpose of Normalisation?

§  Minimize redundancy in data.
§  Remove insert, delete and update anamoly during the database activities.
§  Reduce the need to reorganize data it is modified or enhanced.
§  Normalisation reduces a complex user view to a set of small and stable subgroups of fields or relations.
26.
Define Self Join?

§  Self join means joining one table with itself.
§  The self join can be viewed as a join of two copies of the same table.

27.
What the difference between UNION and UNIONALL?

Union will remove the duplicate rows from the result set while Union all does’nt.

28.
What are different type of Collation Sensitivity?

The different phases of transaction are :

§  Case sensitivity
§  Accent sensitivity
§  Kana Sensitivity
§  Width sensitivity

29.
What is the difference Function and Stored Procedure?

§  UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be.
§  UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
§  Inline UDF›s can be though of as views that take parameters and can be used in JOINs and other Rowset operations.

30.
What is the difference between a local and a global variable?

Local temporary table exists only for the duration of a connection or, if defined inside a compound statement, for the duration of the compound statement.
Global temporary table remains in the database permanently, but the rows exist only within a given connection. When connection are closed, the data in the global temporary table disappears. However, the table definition remains with the database for access when database is opened next time
31.
What is NOT NULL Constraint?

A NOT NULL constraint enforces that the column will not accept null values. The not null constraints are used to enforce domain integrity, as the check constraints.

32.
What is log shipping?

Log shipping is the process of automating the backup of database and transaction log files on a production SQL server, and then restoring them onto a standby server. Enterprise Editions only supports log shipping. In log shipping the transactional log file from one server is automatically updated into the backup database on the other server.

33.
What is Cross Join?

A cross join that does not have a WHERE clause produces the Cartesian product of the tables involved in the join. The size of a Cartesian product result set is the number of rows in the first table multiplied by the number of rows in the second table.

34.
What is Self Join?

A self join can be of any type, as long as the joined tables are the same. A self join is rather unique in that it involves a relationship with only one table.

35.
Define Normalisation?

Normalisation is an essential part of database design. A good understanding of the semantic of data helps the designer to built efficient design using the concept of normalization.
36.
What is the difference between Triggers and Stored Procedure?

Stored Procedures are called by the programmer wherever it wants to fire but triggers fired automatically when insert,delete,updateoccured. And triggers can be implemented to tables & views only where as stored procedure used in the database independently.

37.
What are the properties of Sub-Query?

§  A subquery must be enclosed in the parenthesis.
§  A subquery must be put in the right hand of the comparison operator
§  A subquery cannot contain a ORDER-BY clause.
§  A query can contain more than one sub-queries.

38.
Where are SQL server users names and passwords are stored in sql server?

They get stored in master db in the sysxlogins table.

39.
What are the types of subscriptions in SQL Server replication?

There are two types of replication in sql server are :
§  Push
§  Pull

40.
What does REVERT do in SQL Server 2005?

Restores your previous execution context.If you have changed your execution context with EXECUTE AS, the REVERT statement will restore the last context prior to the EXECUTE AS.
41.
What does NULL mean?

The value NULL means UNKNOWN; it does not mean (empty string). Assuming ANSI_NULLS are on in your SQL Server database, which they are by default, any comparison to the value NULL will yield the value NULL.

42.
What are the Different Types of Normalization?



§  First Normal Form
§  Second Normal Form
§  Third Normal Form
§  Boyce’s Normal Form
§  Fourth Normal Form
§  Fifth Normal Form

43.
What are Page Splits?

Pages are contained in extent. Every extent will have around eight data pages. But all the eight data pages are not created at once; they are created depending on data demand. So when a page becomes full it creates a new page, this process is called as “Page Split”.

44.
What is an Identity?

Identity is a column that automatically generates numeric values.
45.
What is the difference between SET and SELECT?

Both SET and SELECT can be used to assign values to variables. It is recommended that SET @local_variable be used for variable assignment rather than SELECT @local_variable.

Examples
declare @iint
set @i=1
This is used to assign constant values.

select @i=max(column_name)from table_name
for ex.
select @i=max(emp_id) from table_emp.

46.
What is the difference between char ,varchar and nvarchar?

char(n)Fixed length non unicode character data with length of n bytes.n must be a value from 1 through 8,000.

varchar(n)variable length non unicode character data with length of n bytes.

nvarchar(n)variable length unicode character data of n characters. n must be a value from 1 through 4,000.

47.
How many types of triggers are there?

There are three types of triggers.
§  DML Triggers
--> AFTER Triggers
--> INSTEAD OF Triggers
§  DDL Triggers
§  CLR Triggers


No comments:

Post a Comment