Wednesday, April 28, 2010

Database System-V

1. What is View?
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 the view was created with. 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.

2. 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. 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. Clustered indexes define the physical sorting of a database table’s rows in the storage media. For this reason, ea ch database table may have only one clustered index. Non-clustered indexes are created outside of the database table and contain a sorted list of references
to the table itself.

3. What is the difference between clustered and a non-clustered index?
A clustered index is a special type of index that reorders the wa y 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 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.

4. What are the different index configurations a table can have?
A table can have one of the following index configurations:
a. No indexes
b. A clustered index
c. A clustered index and many nonclustered indexes
d. A nonclustered index
e. Many nonclustered indexes

5 .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. In order to work with a cursor we need to perform some steps in the following order:
a. Declare cursor
b. Open cursor
c. Fetch row from the cursor
d. Process fetched row
e. Close cursor
f. Deallocate cursor

Monday, April 19, 2010

Database System-IV

1. What is RDBMS?
Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in tables. Relationships may be created and maintained a cross and among the data and tables. In a relational database, relationships between data items are expressed by means of tables. Interdependencies among these tables are expressed by data values rather than by pointers. This allows a high degree of data independence. An RDBMS ha s the capability to recombine the data items from different files, providing powerful tools for data usage.

2. What is normalization?
Database normalization is a data design and organization process applied to data structures based on rules that help build relational databases. In relational database design, the process of organizing data to minimize redundancy. 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 defined relationships.

3. What are different normalization forms?
1NF: Eliminate Repeating Group
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.

DKNF: Domain-Key Normal Form
A model free from all modification anomalies.

Remember, these normalization guidelines are cumulative. For a database to be in 3NF, it must first
fulfill all the criteria of a 2NF and 1NF database.

4. What is Stored Procedure?
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 different 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.

5. What is 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; the 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 atta ched to a specific table as triggers are. 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.

Wednesday, April 14, 2010

IT Fundamental - IX

1. Array is:
(a) linear data structure
(b) non-linear structure
(c) none of the above
(d) All of the above

2. A data structure in which elements are added and removed from only one end, is known as:
(a) Array
(b) Stack
(c) Queue
(d) None of the above

3. A diamond-shaped box in an Entity-Relationship diagram refers to:
(a) Entity
(b) Relationship
(c) Attribute
(d) Domain

4. The principle means of identifying entities within an entity set is:
(a) Primary Key
(b) Record
(c) Attribute
(d) Tuple

5. Modem refers to:
(a) Modulator
(b) Modulation
(c) Demodulator
(d) Modulator and Demodulator

6. C language is available for which of the following Operating Systems?
(a) DOS
(b) Windows
(c) Unix
(d) All of the above

7. Which of the following have the fastest access time?
(a) Magnetic Tapes
(b) Magnetic Disks
(c) Semiconductor Memories
(d) Compact Disks

8. DMA stands for:
(a) Direct Memory Allocation
(b) Distinct Memory Allocation
(c) Direct Memory Access
(d) Distinct Memory Access

9. Array subscripts in C always start at:
(a):1
(b) 0
(c) 1
(d) Value provided by user

10. Which type of commands in DOS needs additional files for their execution?
(a) Batch Commands
(b) Internal Commands
(c) External Commands
(d) Main Commands

Tuesday, April 06, 2010

IT Fundamental - VIII

1. What is the name of the software that allows us to browse through web pages?
(a) Browser
(b) Mail Client
(c) FTP Client
(d) Messenger

2. What is the address given to a network called?
(a) System Address
(b) SYSID
(c) Process ID
(d) IP Address

3. Which one of the following is a valid DOS command?
(a) LIST *.*
(b) LIST???.???
(c) RECOVER A:
(d) RENAME A:SAMPLE.TXT C:TEST.DOC

4. All system settings in WINDOWS are stored in:
(a) CONTROL.INI
(b) MAIN.INI
(c) SYSTEM.INI
(d) SETTING.INI

5. Which number system is usually followed in a typical 32-bit computer?
(a) 2
(b) 10
(c) 16
(d) 32

6. Which of the following is not an output device:
(a) Printer
(b) Scanner
(c) Flat Screen
(d) Touch Screen

7. A microprocessor is a processor with reduced
(a) instruction set
(b) power requirement
(c) MIPS performance
(d) none of the above

8. Which of the following is not an output of an assembler?
(a) executable program
(b) source listing with line numbers and errors
(c) a symbol table
(d) object program

9. Which layer of OSI model is responsible for routing and flow control:
(a) Presentation
(b) Transport
(c) Network
(d) Data Link

10. Arrays are passed as arguments to a function by
(a) value
(b) reference
(c) both a and b
(d) none of the above

Search Aptipedia