Friday, 10 January 2014

Glossary Terminology part2-A,B,C.

A
abstract class
A class containing one or more pure virtual functions.

accuracy
A quantitative measurement of the error inherent in the representation of a real number.

address
A value that identifies a storage location in memory.

AND
A Boolean operation that yields 0 if either operand is 0 and 1 if both operands are 1.

ANSI C
Any version of C that conforms to the specifications of the American National Standards Institute Committee X3J.

ANSI C++
Any version of C++ that conforms to the specifications of the American National
Standards Institute. At the time of this writing, the standards exist only in draft form and
there are still a lot of details to be worked out.

array
A collection of data elements arranged to be indexed in one or more dimensions. In C++,
arrays are stored in contiguous memory.

ASCII
American Standard Code for Information Interchange. A code to represent characters.
assignment statement
An operation that stores a value in a variable.

auto
A C++ keyword used to create temporary variables.
automatic variable.

B
base class
A class that is used as the base for a derived class.

bit
Binary digit; either of the digits 0 or 1.

bit field
A group of contiguous bits taken together as a unit. This C++ language feature allows the
access of individual bits.

bit flip
The inversion of all bits in an operand. See also complement.

bit operator
See bitwise operator.

bitmapped graphics
Computer graphics where each pixel in the graphic output device is controlled by a single
bit or a group of bits.

bitwise operator
An operator that performs Boolean operations on two operands, treating each bit in an
operand as individual bits and performing the operation bit by bit on corresponding bits.

block
A section of code enclosed in curly braces.

Borland C++
A version of the C++ language for personal computers developed by Borland. This is the
high-end version of Borland's Turbo-C++ product.

boxing (a comment)
The technique of using a combination of asterisks, vertical and horizontal rules, and other
typographic characters to draw a box around a comment in order to set it off from the code.

break
A statement that terminates the innermost execution of for, while, switch, and
do/while statements.

breakpoint
A location in a program where normal execution is suspended and control is turned over to
the debugger.

buffered I/O
Input/output where intermediate storage (a buffer) is used between the source and
destination of an I/O stream.

byte
A group of eight bits.

C
C
A general-purpose computer programming language developed in 1974 at Bell
Laboratories by Dennis Ritchie. C is considered to be a medium- to high-level language.

C++
A language based on C invented in 1980 by Bjarne Stroustrup. First called ''C with
classes," it has evolved into its own language.

C++ code
Computer instructions written in the C++ language.

C++ compiler
Software that translates C++ source code into machine code.

C++ syntax
See syntax.

call by reference
A parameter-passing mechanism where the actual parameter is not passed to a function,
but instead a pointer is used to point to it. (See also call by value.)

call by value
A procedure call where the parameters are passed by passing the values of the
parameters. (See also call by reference.)

case
Acts as a label for one of the alternatives in a switch statement.

cast
To convert a variable from one type to another type by explicitly indicating the type
conversion.

cerr
Standard error stream for C++. (Corresponds to C's stderr.)

CFront
A program to translate C++ code into C code. This program was the basis for the first
C++ compilers. Currently not used for most compilers, as many native C++ compilers
now exist.

CGA
Color graphics adapter. A common color graphics card for the IBM PC.

char
A C++ keyword used to declare variables that represent characters or small integers.

cin
Character in. Standard input stream for C++. (Corresponds to C's stdin.)

class
A data structure consisting of different data types, protections for the members, and
functions to manipulate them.

class (of a variable)
See storage class.

clear a bit
The operation of setting an individual bit to zero. This is not a defined operation in C++.

clog
Standard log file for C++.

code design
A document that describes in general terms how the program is to perform its function.

coding
The act of writing a program in a computer language.

command-line options
Options to direct the course of a program, such as a compiler, that are entered from the
computer console.

comment
Text included in a computer program for the sole purpose of providing information about
the program. Comments are a programmer's notes to himself and future programmers. The
text is ignored by the compiler.

comment block
A group of related comments that convey general information about a program or a section
of program.

compilation
The translation of source code into machine code.

compiler
A system program that does compilation.

compiling
See compilation.

complement
An arithmetic or logical operation. A logical complement is the same as an invert or NOT
operation.

computer language
See programming language.

conditional compilation
The ability to selectively compile parts of a program based on the truth of conditions tested
in conditional directives that surround the code.

continue
A flow control statement that causes the next execution of a loop to begin.
control statement
A statement that determines which statement is to be executed next based on a conditional
test.

control variable
A variable that is systematically changed during the execution of the loop. When the
variable reaches a predetermined value, the loop is terminated.

conversion specification
A C string used by the printf family of functions that specifies how a variable is to be
printed.

cout
Standard output for C++ programs. (Corresponds to C's stdout.)

curly braces
One of the characters { or }. They are used in C++ to delimit groups of elements to treat
them as a unit.

Glossary Terminology Part-1

^  
Symbol for the bitwise exclusive OR operator.
~   
Symbol for the bitwise complement operator. Inverts all bits.
!   
Symbol for the logical NOT operator.
!=   
Not-equal relational operator.
{}   
See curly braces.
|    
 Symbol for the bitwise OR operator.
||   
Symbol for the logical OR operator.
%  
Symbol for the modulus operator.


&   
1. Symbol for the bitwise AND operator.2. A symbol used to precede a variable name (as in &x). Means the address of the named variable (address of x). Used to assign a value to a pointer variable.Used to declare a reference variable.

&& 
Symbol for the logical AND operator (used in comparison operations).



1. Symbol for the multiply operator.
2. Symbol used to precede a pointer variable name that means get the value stored at the
address pointed to by the pointer variable. (*x means get the value stored at x.) Sometimes
known as the de-referencing operator or indirect operator.


+ Symbol for the add operator.

++ Symbol for the incrementation operator.

- Symbol for the subtract operator.

-- Symbol for the decrementation operator.

-> Used to obain a member from a class or structure pointer.

->* Indicattes the item pointed to by a "pointer to member."

/ Symbol for the divide operator.

< Less-than relational operator.

<< 
1.Symbol for the left shift operator.
2.Used by the iostream package for output.
:: Scope operator. Used to indicate which class a particular identifier belongs to.

::* Used to declare a pointer to a class member.
<= Less-than-or-equal-to relational operator.

== Equal relational operator.

> Greater-than relational operator.

>= Greater-than-or-equal-to relational operator.

>> 1.Symbol for the right shift operator.
2.Used by the iostream package for input.


'\0'
End-of-string character (the NULL character).

#define
A C++ preprocessor directive that defines a substitute text for a name.

#endif
The closing bracket to a preprocessor macro section that began with an #ifdef
directive.

#ifdef
Preprocessor directive that checks to see whether a macro name is defined. If defined, thecode following it is included in the source.

#ifndef
Preprocessor directive that checks to see whether a macro name is undefined. 

If it iscurrently undefined, the code following is included in the macro expansion.

#include
A preprocessor directive that causes the named file to be inserted in place of the#include.

#undef A preprocessor directive that cancels a #define.

_ptr A convention used in this book. All pointer variables end with the extension _ptr.

Tuesday, 7 January 2014

SQL QUESTIONS

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.

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, each 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.

What is SQL server agent?
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.

What are different normalization forms?
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.
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.
  

TRUNCATE?
TRUNCATE is faster and uses fewer system and transaction log resources than DELETE.
TRUNCATE removes the data by deallocating the data pages used to store the table’s data, and only the
page deallocations are recorded in the transaction log.
TRUNCATE removes all rows from a table, but the table structure and its columns, constraints, indexes
and so on remain. The counter used by an identity for new rows is reset to the seed for the column.
You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint.
Because TRUNCATE TABLE is not logged, it cannot activate a trigger.
TRUNCATE can not be Rolled back.
TRUNCATE is DDL Command.
TRUNCATE Resets identity of the table.

DELETE?
DELETE removes rows one at a time and records an entry in the transaction log for each deleted row.
If you want to retain the identity counter, use DELETE instead. If you want to remove table definition
and its data, use the DROP TABLE statement.
DELETE Can be used with or without a WHERE clause
DELETE Activates Triggers.
DELETE Can be Rolled back.
DELETE is DML Command.
DELETE does not reset identity of the table.
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.

DBMS QUESTIONS

1. Define query language?
A query is a statement requesting the retrieval of information. The portion of
DML that involves information retrieval is called a query language.

2. Write short notes on Schema diagram.
A database schema along with primary key and foreign key dependencies can be
depicted pictorially by schema diagram. Each relation appears as a box with
attributes listed inside it and the relation name above it.

3. What is foreign key?
A relation schema r1 derived from an ER schema may include among its
attributes the primary key of another relation schema r2.this attribute is called a foreign
key from r1 referencing r2.

4. What is a SELECT operation?
The select operation selects tuples that satisfy a given predicate. We use the
lowercase letter s to denote selection.

5. Give the levels of data abstraction?
a) Physical level
b) logical level
c) view level

6. Define instance and schema?
Instance: Collection of data stored in the data base at a particular moment is
called an Instance of the database.
Schema: The overall design of the data base is called the data base schema.

7. Define the terms 1) physical schema 2) logical schema.
Physical schema: The physical schema describes the database design at the
physical level, which is the lowest level of abstraction describing how the data are
actually stored.
Logical schema: The logical schema describes the database design at the logical
level, which describes what data are stored in the database and what relationship exists
among the data.

8. What is conceptual schema?
The schemas at the view level are called subschemas that describe different views
of the database.

9. Define data model?
A data model is a collection of conceptual tools for describing data, data
relationships, data semantics and consistency constraints.

10. What is storage manager?
A storage manager is a program module that provides the interface between the
low level data stored in a database and the application programs and queries submitted to
the system.

11. What are the components of storage manager?
The storage manager components include
a) Authorization and integrity manager
b) Transaction manager
c) File manager
d) Buffer manager

12. What is the purpose of storage manager?
The storage manager is responsible for the following
a) Interaction with he file manager
b) Translation of DML commands in to low level file system commands
c) Storing, retrieving and updating data in the database

13. List the data structures implemented by the storage manager.
The storage manager implements the following data structure
a) Data files
b) Data dictionary
c) indices

14. What is a data dictionary?
A data dictionary is a data structure which stores meta data about the structure of
the database ie. the schema of the database.

15. What is an entity relationship model?
The entity relationship model is a collection of basic objects called entities and
relationship among those objects. An entity is a thing or object in the real world that is
distinguishable from other objects.

16. What are attributes? Give examples.
An entity is represented by a set of attributes. Attributes are descriptive properties
possessed by each member of an entity set.
Example: possible attributes of customer entity are customer name, customer id,
customer street, customer city.

17. What is relationship? Give examples
A relationship is an association among several entities.
Example: A depositor relationship associates a customer with each account that
he/she has.

18. Define the terms
i) Entity set
ii) Relationship set
Entity set: The set of all entities of the same type is termed as an entity set.
Relationship set: The set of all relationships of the same type is termed as a
relationship set.

19. Define single valued and multivalued attributes.
Single valued attributes: attributes with a single value for a particular entity are
called single valued attributes.
Multivalued attributes: Attributes with a set of value for a particular entity are
called multivalued attributes.

20. What are stored and derived attributes?
Stored attributes: The attributes stored in a data base are called stored attributes.
Derived attributes: The attributes that are derived from the stored attributes are
called derived attributes.

21. What are composite attributes?
Composite attributes can be divided in to sub parts.

22. Define null values.
In some cases a particular entity may not have an applicable value for an attribute
or if we do not know the value of an attribute for a particular entity. In these cases null
value is used.

23. Define the terms
i) Entity type
ii) Entity set
Entity type: An entity type defines a collection of entities that have the same
attributes. 
Entity set: The set of all entities of the same type is termed as an entity set.

24. What is meant by the degree of relationship set?
The degree of relationship type is the number of participating entity types.

25. Define the terms
i) Key attribute
ii) Value set
Key attribute: An entity type usually has an attribute whose values are distinct
from each individual entity in the collection. Such an attribute is called a key attribute.
Value set: Each simple attribute of an entity type is associated with a value set
that specifies the set of values that may be assigned to that attribute for each individual
entity.

26. Define weak and strong entity sets?
Weak entity set: entity set that do not have key attribute of their own are called
weak entity sets.
Strong entity set: Entity set that has a primary key is termed a strong entity set.

27. What does the cardinality ratio specify?
Mapping cardinalities or cardinality ratios express the number of entities to which
another entity can be associated. Mapping cardinalities must be one of the
following:
• One to one
• One to many
• Many to one
• Many to many

28. Explain the two types of participation constraint.
Total: The participation of an entity set E in a relationship set R is said to
be total if every entity in E participates in at least one relationship in R.
Partial: if only some entities in E participate in relationships in R, the
participation of entity set E in relationship R is said to be partial.

29. Define the terms
i) DDL
ii) DML
DDL: Data base schema is specified by a set of definitions expressed by a special
language called a data definition language.
DML: A data manipulation language is a language that enables users to access or
manipulate data as organized by the appropriate data model.

30. Write short notes on relational model
The relational model uses a collection of tables to represent both data and the
relationships among those data. The relational model is an example of a record
based model.

31. Define tuple and attribute
Attributes: column headers
Tuple: Row

32. Define the term relation.
Relation is a subset of a Cartesian product of list domains.

33. Define tuple variable
Tuple variable is a variable whose domain is the set of all tuples.

34. Define the term Domain.
For each attribute there is a set of permitted values called the domain of that
attribute.

35. What is a candidate key?
Minimal super keys are called candidate keys.

36. What is a primary key?
Primary key is chosen by the database designer as the principal means of
identifying an entity in the entity set.

37. What is a super key?
A super key is a set of one or more attributes that collectively allows us to
identify uniquely an entity in the entity set.

38. Define- relational algebra.
The relational algebra is a procedural query language. It consists of a set of
operations that take one or two relation as input and produce a new relation as
output.

Thursday, 1 August 2013

C++ TUTORIALS

A programming language is a set of instructions and a series of lexical conventions specifically designed to order computers what to do.When choosing a programming language to make a project, many different considerations can be taken. First, one must decide what is known as the level of the programming language. The level determines how near to the hardware the programming language is. In the lower level languages, instructions are written thinking directly on interfacing with hardware, while in "high level" ones a more abstract or conceptual code is written.Generally, high level code is more portable, that means it can work in more different machines with a smaller number of modifications, whereas a low level language is limited by the peculiarides of the hardware which it was written for. Nevertheless, the advantage of low level code is that it is usually faster due to the fact that it 
is indeed written taking advantage of the possibilities of a specific machine.A higher or lower level of programming is to be chosen for a specific project depending on the type of program
that is being developed. For example, when a hardware driver is developed for an operating system obviously a very low level is used for programming. While when big applications are developed usually a higher level is chosen, or a combination of critic parts written in low level languages and others in higher ones.Although there are languages that are clearly thought to be low level, like Assembly, whose instruction sets are adapted to each machine the code is made for, and other languages are inherently high level, like the Java, that is designed to be totally independent of the platform where is going to run. The C++ language is in a middle position, since it can interact directly with the hardware almost with no limitations, and can as well abstract lower layers and work like one of the most powerful high level languages.