This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How To Get error And rowcount At The Same Time? |
|
Answer» If @@Rowcount is CHECKED after Error CHECKING statement then it will have 0 as the value of @@Recordcount as it would have been reset. And if @@Recordcount is checked before the error‐checking statement then @@Error would get reset. To get @@error and @@rowcount at the same time do both in same statement and store them in local variable. SELECT @RC = @@ROWCOUNT, @ER = @@ERROR. If @@Rowcount is checked after Error checking statement then it will have 0 as the value of @@Recordcount as it would have been reset. And if @@Recordcount is checked before the error‐checking statement then @@Error would get reset. To get @@error and @@rowcount at the same time do both in same statement and store them in local variable. SELECT @RC = @@ROWCOUNT, @ER = @@ERROR. |
|
| 2. |
What Is Not Null Constraint? |
|
Answer» 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. 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. |
|
| 3. |
What Is Check Constraint? |
|
Answer» A CHECK CONSTRAINT is USED to limit the values that can be PLACED in a column. The check constraints are used to enforce DOMAIN integrity. A CHECK constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity. |
|
| 4. |
What Is Foreign Key? |
|
Answer» A FOREIGN KEY constraint PREVENTS any actions that would destroy links between tables with the corresponding DATA values. A foreign key in one table points to a primary key in ANOTHER table. Foreign keys prevent actions that would LEAVE rows with foreign key values when there are no primary keys with that value. The foreign key CONSTRAINTS are used to enforce referential integrity. A FOREIGN KEY constraint prevents any actions that would destroy links between tables with the corresponding data values. A foreign key in one table points to a primary key in another table. Foreign keys prevent actions that would leave rows with foreign key values when there are no primary keys with that value. The foreign key constraints are used to enforce referential integrity. |
|
| 5. |
What Is Unique Key Constraint? |
|
Answer» 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. 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. |
|
| 6. |
What Is Primary Key? |
|
Answer» A PRIMARY KEY constraint is a unique identifier for a ROW within a database table. Every table should have a primary key constraint to UNIQUELY identify each row and only one primary key constraint can be created for each table. The primary key CONSTRAINTS are used to enforce entity integrity. A PRIMARY KEY constraint is a unique identifier for a row within a database table. Every table should have a primary key constraint to uniquely identify each row and only one primary key constraint can be created for each table. The primary key constraints are used to enforce entity integrity. |
|
| 7. |
What Is The Stuff Function And How Does It Differ From The Replace Function? |
|
Answer» STUFF function is used to overwrite existing CHARACTERS. Using this syntax, STUFF (string_expression, START, length, replacement_characters), string_expression is the string that will have characters substituted, start is the starting position, length is the number of characters in the string that are substituted, and replacement_ characters are the new characters interjected into the string. REPLACE function to replace existing characters of all occurrences. Using the syntax REPLACE (string_expression, search_string, replacement_string), where every incidence of search_string FOUND in the string_expression will be replaced with replacement_string. STUFF function is used to overwrite existing characters. Using this syntax, STUFF (string_expression, start, length, replacement_characters), string_expression is the string that will have characters substituted, start is the starting position, length is the number of characters in the string that are substituted, and replacement_ characters are the new characters interjected into the string. REPLACE function to replace existing characters of all occurrences. Using the syntax REPLACE (string_expression, search_string, replacement_string), where every incidence of search_string found in the string_expression will be replaced with replacement_string. |
|
| 8. |
What Is The Difference Between A Local And A Global Temporary Table? |
|
Answer» A 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. A global temporary table remains in the database permanently, but the rows exist only within a GIVEN connection. When connection is 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. A 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. A global temporary table remains in the database permanently, but the rows exist only within a given connection. When connection is 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. |
|
| 9. |
What Does It Mean To Have Quoted_identifier On? What Are The Implications Of Having It Off? |
|
Answer» When SET QUOTED_IDENTIFIER is ON, IDENTIFIERS can be delimited by DOUBLE QUOTATION marks, and literals must be delimited by single quotation marks. When SET QUOTED_IDENTIFIER is OFF, identifiers cannot be quoted and must follow all Transact‐SQL RULES for identifiers. When SET QUOTED_IDENTIFIER is ON, identifiers can be delimited by double quotation marks, and literals must be delimited by single quotation marks. When SET QUOTED_IDENTIFIER is OFF, identifiers cannot be quoted and must follow all Transact‐SQL rules for identifiers. |
|
| 10. |
Name 3 Ways To Get An Accurate Count Of The Number Of Records In A Table1? |
|
Answer» ANSWER : SELECT * FROM TABLE1, SELECT COUNT(*) FROM table1, SELECT rows FROM sysindexes WHERE id = OBJECT_ID(table1) AND indid < 2. |
|
| 11. |
What Is Log Shipping? |
|
Answer» 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 servr. If one server fails, the other server will have the same DB and can be used this as the DISASTER Recovery plan. The key feature of log shipping is that it will automatically backup transaction logs throughout the day and automatically resore them on the standby server at defined interval. 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 servr. If one server fails, the other server will have the same db and can be used this as the Disaster Recovery plan. The key feature of log shipping is that it will automatically backup transaction logs throughout the day and automatically resore them on the standby server at defined interval. |
|
| 12. |
Can A Stored Procedure Call Itself Or Recursive Stored Procedure? How Much Level Sp Nesting Is Possible? |
|
Answer» YES. Because Transact‐SQL supports recursion, you can write stored procedures that call themselves. Recursion can be DEFINED as a method of problem SOLVING wherein the solution is arrived at by repetitively applying it to subsets of the problem. A common application of recursive logic is to perform numeric computations that lend themselves to repetitive evaluation by th same processing STEPS. Stored procedures are nested when one stored PROCEDURE calls another or executes managed code by referencing a CLR routine, type, or aggregate. You can nest stored procedures and managed code references up to 32 levels. Yes. Because Transact‐SQL supports recursion, you can write stored procedures that call themselves. Recursion can be defined as a method of problem solving wherein the solution is arrived at by repetitively applying it to subsets of the problem. A common application of recursive logic is to perform numeric computations that lend themselves to repetitive evaluation by th same processing steps. Stored procedures are nested when one stored procedure calls another or executes managed code by referencing a CLR routine, type, or aggregate. You can nest stored procedures and managed code references up to 32 levels. |
|
| 13. |
What Is Sql Server Agent? |
|
Answer» SQL SERVER agent plays an IMPORTANT role in the day‐to‐day tasks of a database administrator (DBA). It is often overlooked as ONE of the main tools for SQL Server management. Its PURPOSE is to ease the implementation of tasks for the DBA, with its full‐function scheduling engine, which allows you to schedule your own jobs and scripts. SQL Server agent plays an important role in the day‐to‐day tasks of a database administrator (DBA). It is often overlooked as one of the main tools for SQL Server management. Its purpose is to ease the implementation of tasks for the DBA, with its full‐function scheduling engine, which allows you to schedule your own jobs and scripts. |
|
| 14. |
Which Command Using Query Analyzer Will Give You The Version Of Sql Server And Operating System? |
|
Answer» SELECT SERVERPROPERTY ('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition'). SELECT SERVERPROPERTY ('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition'). |
|
| 15. |
What Are The Authentication Modes In Sql Server? How Can It Be Changed? |
|
Answer» Windows MODE and Mixed Mode ‐ SQL & Windows. To change authentication mode in SQL Server click Start, PROGRAMS, Microsoft SQL Server and click SQL Enterprise Manager to run SQL Enterprise Manager from the Microsoft SQL Server program GROUP. Select the server then from the Tools menu select SQL Server Configuration PROPERTIES, and choose the Security PAGE. Windows mode and Mixed Mode ‐ SQL & Windows. To change authentication mode in SQL Server click Start, Programs, Microsoft SQL Server and click SQL Enterprise Manager to run SQL Enterprise Manager from the Microsoft SQL Server program group. Select the server then from the Tools menu select SQL Server Configuration Properties, and choose the Security page. |
|
| 16. |
What Is Sql Profiler? |
|
Answer» 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. For example, you can monitor a PRODUCTION environment to see which stored procedures are hampering performances by executing too slowly. Use SQL Profiler to monitor only the events in which you are interested. If traces are BECOMING too large, you can filter them based on the information you want, so that only a subset of the event data is collected. Monitoring too many events adds overhead to the server and the monitoring process and can cause the trace file or trace table o grow very large, especially when the monitoring process takes place over a long period of time. 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. For example, you can monitor a production environment to see which stored procedures are hampering performances by executing too slowly. Use SQL Profiler to monitor only the events in which you are interested. If traces are becoming too large, you can filter them based on the information you want, so that only a subset of the event data is collected. Monitoring too many events adds overhead to the server and the monitoring process and can cause the trace file or trace table o grow very large, especially when the monitoring process takes place over a long period of time. |
|
| 17. |
What Are The Properties And Different Types Of Sub-queries? |
|
Answer» Properties of Sub‐QUERY
Types of Sub‐query
Properties of Sub‐Query Types of Sub‐query |
|
| 18. |
What Is The Difference Between A Having Clause And A Where Clause? |
|
Answer» They specify a search condition for a GROUP or an aggregate. But the difference is that 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. They specify a search condition for a group or an aggregate. But the difference is that 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. |
|
| 19. |
When Is The Use Of Update_statistics Command? |
|
Answer» This COMMAND is basically used when a large PROCESSING of data has occurred. If a large amount of DELETIONS any modification or Bulk Copy into the tables has occurred, it has to UPDATE the indexes to take these changes into account. UPDATE_STATISTICS updates the indexes on these tables ACCORDINGLY. This command is basically used when a large processing of data has occurred. If a large amount of deletions any modification or Bulk Copy into the tables has occurred, it has to update the indexes to take these changes into account. UPDATE_STATISTICS updates the indexes on these tables accordingly. |
|
| 20. |
What Is Difference Between Delete & Truncate Commands? |
|
Answer» Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we RUN the truncate commad. TRUNCATE
DELETE
Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate commad. TRUNCATE DELETE |
|
| 21. |
What Iss The Difference Between A Primary Key And A Unique Key? |
|
Answer» Both primary KEY and UNIQUE key enforces 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 NULL's, but unique key allows one NULL only. Both primary key and unique key enforces 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 NULL's, but unique key allows one NULL only. |
|
| 22. |
What Is Oltp (online Transaction Processing)? |
|
Answer» In OLTP ‐ online transaction PROCESSING systems relational database design use the discipline of data modeling and generally follow the odd RULES of data normalization in order to ensure absolute data integrity. USING these rules complex information is broken down into its most SIMPLE structures (a table) where all of the individual atomic level elements relate to each other and satisfy the normalization rules. In OLTP ‐ online transaction processing systems relational database design use the discipline of data modeling and generally follow the odd rules of data normalization in order to ensure absolute data integrity. Using these rules complex information is broken down into its most simple structures (a table) where all of the individual atomic level elements relate to each other and satisfy the normalization rules. |
|
| 23. |
What Are Different Types Of Collation Sensitivity? |
Answer»
|
|
| 24. |
What Are The Different Index Configurations A Table Can Have? |
|
Answer» A table can have one of the following index configurations:
A table can have one of the following index configurations: |
|
| 25. |
What Are The Difference Between Clustered And A Non-clustered Index? |
|
Answer» A 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. A non clustered index is a special type of index in which the logical order of the index does not MATCH the physical stored ordr of the rows on disk. The leaf node of a non clustered index does not CONSIST of the data pages. INSTEAD, the leaf nodes contain index rows. A 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. A non clustered index is a special type of index in which the logical order of the index does not match the physical stored ordr of the rows on disk. The leaf node of a non clustered index does not consist of the data pages. Instead, the leaf nodes contain index rows. |
|
| 26. |
Which Tcp/ip Port Does Sql Server Run On? How Can It Be Changed? |
|
Answer» SQL SERVER RUNS on port 1433. It can be CHANGED from the Network UTILITY TCP/IP properties –> Port number, both on CLIENT and the server. SQL Server runs on port 1433. It can be changed from the Network Utility TCP/IP properties –> Port number, both on client and the server. |
|
| 27. |
What Is Datawarehousing? |
Answer»
|
|
| 28. |
What Is Identity? |
|
Answer» Identity (or AutoNumber) is a column that automatically generates numeric values. A start and increment value can be set, but most DBA LEAVE these at 1. A GUID column also generates NUMBERS; the value of this cannot be controlled. Identity/GUID columns do not NEED to be indexed. Identity (or AutoNumber) is a column that automatically generates numeric values. A start and increment value can be set, but most DBA leave these at 1. A GUID column also generates numbers; the value of this cannot be controlled. Identity/GUID columns do not need to be indexed. |
|
| 29. |
What Is User Defined Functions? What Kind Of User-defined Functions Can Be Created? |
|
Answer» User‐Defined Functions allow defining its own T‐SQL functions that can accept 0 or more parameters and return a single scalar data value or a table data type. Different Kinds of User‐Defined Functions created are: Scalar User‐Defined Function: Inline Table‐Value User‐Defined Function Multi‐statement Table‐Value User‐Defined Function User‐Defined Functions allow defining its own T‐SQL functions that can accept 0 or more parameters and return a single scalar data value or a table data type. Different Kinds of User‐Defined Functions created are: Scalar User‐Defined Function: Inline Table‐Value User‐Defined Function Multi‐statement Table‐Value User‐Defined Function |
|
| 30. |
What Are Primary Keys And Foreign Keys? |
|
Answer» 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. 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. |
|
| 31. |
What Are Different Types Of Join? |
|
Answer» CROSS JOIN Inner Join: Outer Join: Left Outer Join: Right Outer Join: Full Outer Join: SELF Join: Cross Join Inner Join: Outer Join: Left Outer Join: Right Outer Join: Full Outer Join: Self Join: |
|
| 32. |
What Is Sub-query? Explain Properties Of Sub-query? |
|
Answer» Sub‐queries are often referred to as sub‐selects, as they allow a SELECT statement to be EXECUTED arbitrarily within the body of another SQL statement. A sub‐query is executed by enclosing it in a set of parentheses. Sub‐queries are generally used to return a single ROW as an atomic VALUE, though they may be used to compare values against multiple rows with the IN keyword. A sub query is a SELECT statement that is nested within another T‐SQL statement. A sub query SELECT statement if executed independently of the T‐SQL statement, in which it is nested, will return a resultset. Meaning a subquery SELECT statement can standalone and is not depended on the statement in which it is nested. A subquery SELECT statement can return any number of values, and can be found in the column list of a SELECT statement, a FROM, GROUP BY, HAVING, and/or ORDER BY clauses of a T‐SQL statement. A Subquery can also be used as a parameter to a function call. BASICALLY a subquery can be used anywhere an expression can be used. Sub‐queries are often referred to as sub‐selects, as they allow a SELECT statement to be executed arbitrarily within the body of another SQL statement. A sub‐query is executed by enclosing it in a set of parentheses. Sub‐queries are generally used to return a single row as an atomic value, though they may be used to compare values against multiple rows with the IN keyword. A sub query is a SELECT statement that is nested within another T‐SQL statement. A sub query SELECT statement if executed independently of the T‐SQL statement, in which it is nested, will return a resultset. Meaning a subquery SELECT statement can standalone and is not depended on the statement in which it is nested. A subquery SELECT statement can return any number of values, and can be found in the column list of a SELECT statement, a FROM, GROUP BY, HAVING, and/or ORDER BY clauses of a T‐SQL statement. A Subquery can also be used as a parameter to a function call. Basically a subquery can be used anywhere an expression can be used. |
|
| 33. |
What Is Difference Between Function And Stored Procedure? |
|
Answer» UDF can be USED in the SQL STATEMENTS anywhere in the WHERE/HAVING/SELECT section where as Stored PROCEDURES cannot be. UDF's that return tables can be treated as another ROWSET. This can be used in JOIN's with other tables. Inline UDF's can be thought of as VIEWS that take parameters and can be used in JOINs and other Rowset operations. UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be. UDF's that return tables can be treated as another rowset. This can be used in JOIN's with other tables. Inline UDF's can be thought of as views that take parameters and can be used in JOINs and other Rowset operations. |
|
| 34. |
What Is Collation? |
|
Answer» The physical STORAGE of character strings in SQL Server is controlled by collations. A collation specifies the BIT patterns that represent each character and the rules by which characters are SORTED and compared. The physical storage of character strings in SQL Server is controlled by collations. A collation specifies the bit patterns that represent each character and the rules by which characters are sorted and compared. |
|
| 35. |
What Is Cursor? |
|
Answer» 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. In order to work with a cursor we need to perform some steps in the following order:
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. In order to work with a cursor we need to perform some steps in the following order: |
|
| 36. |
What Is A Linked Server? |
|
Answer» 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. Stored Procedure sp_addlinked server, sp_addlinkedsrvlogin will be used add new 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. Stored Procedure sp_addlinked server, sp_addlinkedsrvlogin will be used add new Linked Server. |
|
| 37. |
What Is Index? |
|
Answer» 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. The users cannot see the indexes; they are just used to speed up QUERIES. Effective indexes are one of the best ways to improve performance in a DATABASE application. A table scan happens when there is no index available to help a query. In a table scan SQL Server examines EVERY row in the table to satisfy the query results. Table scans are sometimes unavoidable, but on large tables, scans have a terrific impact on performance. 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. The users cannot see the indexes; they are just used to speed up queries. Effective indexes are one of the best ways to improve performance in a database application. A table scan happens when there is no index available to help a query. In a table scan SQL Server examines every row in the table to satisfy the query results. Table scans are sometimes unavoidable, but on large tables, scans have a terrific impact on performance. |
|
| 38. |
What Is View? |
|
Answer» A simple view can be thought of as a subset of a table. It can be used for retrieving data, as well as updating or deleting rows. Rows updated or DELETED in the view are updated or deleted in the table when the view was created. It should also be noted that as data in the original table changes, so does data in the view, as views are the way to look at part of the original table. The RESULTS of using a view are not permanently stored in the database. The data accessed through a view is actually constructed using STANDARD T‐SQL select COMMAND and can come from ONE to many different base tables or even other views. A simple view can be thought of as a subset of a table. It can be used for retrieving data, as well as updating or deleting rows. Rows updated or deleted in the view are updated or deleted in the table when the view was created. It should also be noted that as data in the original table changes, so does data in the view, as views are the way to look at part of the original table. The results of using a view are not permanently stored in the database. The data accessed through a view is actually constructed using standard T‐SQL select command and can come from one to many different base tables or even other views. |
|
| 39. |
What Is Trigger? |
|
Answer» A trigger is a SQL procedure that initiates an action when an event (INSERT, DELETE or UPDATE) occurs. Triggers are stored in and managed by the DBMS. Triggers are used to maintain the referential integrity of DATA by changing the data in a systematic fashion. A trigger cannot be called or EXECUTED; DBMS AUTOMATICALLY fires the trigger as a result of a data modification to the associated table. Triggers can be viewed as SIMILAR to stored procedures in that both consist of procedural logic that is stored at the database level. Stored procedures, however, are not event‐drive and are not attached to a specific table as triggers. Stored procedures are explicitly executed by invoking a CALL to the procedure while triggers are implicitly executed. In addition, triggers can also execute stored procedures. Nested Trigger: A trigger can also contain INSERT, UPDATE and DELETE logic WITHIN itself, so when the trigger is fired because of data modification it can also cause another data modification, thereby firing another trigger. A trigger that contains data modification logic within itself is called a nested trigger. A trigger is a SQL procedure that initiates an action when an event (INSERT, DELETE or UPDATE) occurs. Triggers are stored in and managed by the DBMS. Triggers are used to maintain the referential integrity of data by changing the data in a systematic fashion. A trigger cannot be called or executed; DBMS automatically fires the trigger as a result of a data modification to the associated table. Triggers can be viewed as similar to stored procedures in that both consist of procedural logic that is stored at the database level. Stored procedures, however, are not event‐drive and are not attached to a specific table as triggers. Stored procedures are explicitly executed by invoking a CALL to the procedure while triggers are implicitly executed. In addition, triggers can also execute stored procedures. Nested Trigger: A trigger can also contain INSERT, UPDATE and DELETE logic within itself, so when the trigger is fired because of data modification it can also cause another data modification, thereby firing another trigger. A trigger that contains data modification logic within itself is called a nested trigger. |
|
| 40. |
What Is Stored Procedure? |
|
Answer» A stored procedure is a named GROUP of SQL statements that have been PREVIOUSLY created and stored in the server DATABASE. Stored procedures accept input parameters so that a single procedure can be used over the network by several clients using diferent input data and when the procedure is modified, all clients automatically get the new version. Stored procedures reduce network traffic and IMPROVE PERFORMANCE. Stored procedures can be used to help ensure the integrity of the database. E.g: sp_helpdb,sp_renamedb,sp_depends etc. A stored procedure is a named group of SQL statements that have been previously created and stored in the server database. Stored procedures accept input parameters so that a single procedure can be used over the network by several clients using diferent input data and when the procedure is modified, all clients automatically get the new version. Stored procedures reduce network traffic and improve performance. Stored procedures can be used to help ensure the integrity of the database. E.g: sp_helpdb,sp_renamedb,sp_depends etc. |
|
| 41. |
What Are Different Normalization Forms? |
|
Answer» 1NF:Eliminate Repeating Groups Make a separate table for each set of related attributes,and give each table a primary key.Each field contains at most one value from its attribute domain. 2NF:Eliminate Redundant DATA If an attribute depends on only part of a multi‐valued key, remove it to a separate table. 3NF:Eliminate Columns Not Dependent On Key If attributes do not contribute to a description of the key, remove them to a separate table. All attributes must be directly dependent on the primary key. BCNF:Boyce‐Codd NORMAL Form If there are non‐trivial dependencies between candidate key attributes,separate them out into distinct tables. 4NF:Isolate Independent Multiple Relationships No table MAY contain two or more 1:n or n:m relationships that are not directly related. 5NF:Isolate Semantically Related Multiple Relationships: There may be practical constrains on information that justify separating logically related many‐to‐many relationships. ONF:Optimal Normal Form A model limited to only simple(elemental) facts,as expressed in Object Role Model NOTATION. 1NF:Eliminate Repeating Groups Make a separate table for each set of related attributes,and give each table a primary key.Each field contains at most one value from its attribute domain. 2NF:Eliminate Redundant Data If an attribute depends on only part of a multi‐valued key, remove it to a separate table. 3NF:Eliminate Columns Not Dependent On Key If attributes do not contribute to a description of the key, remove them to a separate table. All attributes must be directly dependent on the primary key. BCNF:Boyce‐Codd Normal Form If there are non‐trivial dependencies between candidate key attributes,separate them out into distinct tables. 4NF:Isolate Independent Multiple Relationships No table may contain two or more 1:n or n:m relationships that are not directly related. 5NF:Isolate Semantically Related Multiple Relationships: There may be practical constrains on information that justify separating logically related many‐to‐many relationships. ONF:Optimal Normal Form A model limited to only simple(elemental) facts,as expressed in Object Role Model notation. |
|
| 42. |
What Is De-normalization? |
|
Answer» De‐normalization is the process of attempting to optimize the performance of a database by ADDING redundant data. It is sometimes necessary because current DBMS's IMPLEMENT the relational model poorly. A true relational DBMS would allow for a fully normalized database at the logical LEVEL, while providing physical storage of data that is tuned for high performance. De‐normalization is a technique to move from HIGHER to lower normal forms of database modeling in ORDER to speed up database access. De‐normalization is the process of attempting to optimize the performance of a database by adding redundant data. It is sometimes necessary because current DBMS's implement the relational model poorly. A true relational DBMS would allow for a fully normalized database at the logical level, while providing physical storage of data that is tuned for high performance. De‐normalization is a technique to move from higher to lower normal forms of database modeling in order to speed up database access. |
|
| 43. |
What Is Normalization? |
|
Answer» Database normalization is a data design and organization process applied to data STRUCTURES based on rules that help building rlational DATABASES. In RELATIONAL database design, the process of ORGANIZING data to minimize redundancy is called normalization. Normalization usually involves dividing a database into two or more tables and defining relationships between the tables. The objective is to isolate data so that ADDITIONS, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database via the define relationships. Database normalization is a data design and organization process applied to data structures based on rules that help building rlational databases. In relational database design, the process of organizing data to minimize redundancy is called normalization. Normalization usually involves dividing a database into two or more tables and defining relationships between the tables. The objective is to isolate data so that additions, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database via the define relationships. |
|
| 44. |
What Are The Properties Of The Relational Tables? |
|
Answer» RELATIONAL tables have six properties:
Relational tables have six properties: |
|
| 45. |
What Is Rdbms? |
|
Answer» Relational Data Base Management SYSTEMS (RDBMS) are database management systems that maintain data records and INDICES in tables. RELATIONSHIPS may be created and maintained across and among the data and tables. In a relational database, relationships between data items are expressed by means of tables. Inter dependencies among these tables are expressed by data VALUES rather than by pointers. This ALLOWS a high degree of data independence. An RDBMS has the capability to recombine the data items from different files, providing powerful tools for data usage. Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in tables. Relationships may be created and maintained across and among the data and tables. In a relational database, relationships between data items are expressed by means of tables. Inter dependencies among these tables are expressed by data values rather than by pointers. This allows a high degree of data independence. An RDBMS has the capability to recombine the data items from different files, providing powerful tools for data usage. |
|
| 46. |
What Is The Difference Between Server.transfer And Response.redirect? |
|
Answer» Response.Redirect: This tells the browser that the requested page can be FOUND at a new location. The browser then initiates another request to the new page loading its contents in the browser. This results in two requests by the browser. Server.Transfer: It transfers execution from the first page to the second page on the server. As far as the browser client is CONCERNED, it made one request and the INITIAL page is the one responding with content. The benefit of this approach is one less round TRIP to the server from the client browser. Also, any posted form variables and query string parameters are AVAILABLE to the second page as well. Response.Redirect: This tells the browser that the requested page can be found at a new location. The browser then initiates another request to the new page loading its contents in the browser. This results in two requests by the browser. Server.Transfer: It transfers execution from the first page to the second page on the server. As far as the browser client is concerned, it made one request and the initial page is the one responding with content. The benefit of this approach is one less round trip to the server from the client browser. Also, any posted form variables and query string parameters are available to the second page as well. |
|
| 47. |
Describe Paging In Asp.net? |
|
Answer» The DataGrid control in ASP.NET enables EASY paging of the data. The AllowPaging property of the DataGrid can be set to True to perform paging, ASP.NET automatically PERFORMS paging and provides the hyperlinks to the other pages in different STYLES, based on the property that has been set for PagerStyle.Mode. The DataGrid control in ASP.NET enables easy paging of the data. The AllowPaging property of the DataGrid can be set to True to perform paging, ASP.NET automatically performs paging and provides the hyperlinks to the other pages in different styles, based on the property that has been set for PagerStyle.Mode. |
|
| 48. |
What Is Data Binding? |
|
Answer» Data binding is a way used to CONNECT values from a COLLECTION of data (e.g. DataSet) to the controls on a web FORM. The values from the dataset are automatically displayed in the controls without having to write separate code to DISPLAY them. Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the controls on a web form. The values from the dataset are automatically displayed in the controls without having to write separate code to display them. |
|
| 49. |
List The Asp.net Validation Controls? |
Answer»
|
|
| 50. |
What Is Code-behind? |
|
Answer» Code-Behind is a CONCEPT where the contents of a page are in one file and the server-side code is in another page. This allows different people to work on the same page at the same time and also allows either part of the page to be EASILY REDESIGNED, with no CHANGES REQUIRED in the other. An Inherits attribute is added to the @ Page directive to specify the location of the Code-Behind file to the ASP.NET page. Code-Behind is a concept where the contents of a page are in one file and the server-side code is in another page. This allows different people to work on the same page at the same time and also allows either part of the page to be easily redesigned, with no changes required in the other. An Inherits attribute is added to the @ Page directive to specify the location of the Code-Behind file to the ASP.NET page. |
|