Wednesday, 31 July 2013

MCQ's in Teaching Aptitude Set II



1.   All the following are acceptable goals for dealing with behaviour problems in the      classroom, except:
 (A) helping the child to improve his/her self-control
 (B) being impersonal and objective
 (C) understanding the offense
 (D) utilizing appeals to children that have personal implications
 (E) punishing, when necessary, in private
       Ans:D
2.      The term ‘identical elements is closely associated with:
 
(A) group instruction
 (B) transfer of learning
 (C) jealousy between twins
 (D) similar test questions
 (E) The scientific method
       Ans:B
3.  All of the following are true about phobias, except that
      (A) They are generated by an early emotional experience
      (B) The sufferer cannot the impulse to avoid them
      (C) The sufferer will resort to reckless activities to conceal them
      (D) They can be overcome
      (E) Acrophobia is a fear of open places agoraphobia is a fear of high places
      Ans:E
4.   Teacher tenure laws can best be justified because they
     (A) protect teachers whose political views differ sharply with those of the              community
     (B) Provide for stability of staffing
     (C) Allow an experienced teacher to plan creatively
     (D) Protect teachers from excessive requirements of principals
     (E) Prevent teachers from leaving to accept positions in higher paying school districts
Ans:A
5.  The trial and error method of instruction is best enhanced by:
   
(A) role playing
    (B) programmed instruction
    (C) the developmental lesson
    (D) an audio visual lession
    (E) independent study
    Ans:E
6.  All of the following are appropriate areas for pupil teacher planning except
    (A) the day’s schedule
    (B) the selection of committees
    (C) the sequence in a skills programme
    (D) a class party
    (E) the selection of recreational reading
    Ans:C
7.  Curriculum makers have the most difficulty when:
     
(A) there is an inflationary cycle
     (B) the nature of the student population is changing
     (C) parents are participants
     (D) teachers unions insist on input
     (E) school boards must their final approval
    Ans:B
8.  De facto school segregation is segregation that is primarily a result of:
    (A) guidelines issued by the State Commissioner of Education
    (B) discriminatory zoning of a local school board
    (C) Residence patterns of the community
    (D) Federal education laws
    (E) Rulings of the courts
    Ans:C
9.  Of the following the statement that is least educationally valid is that:
    (A) heterogeneous grouping is undemocratic
    (B) Drill periods should be brief
    (C) Study habits should be taught
    (D) Overlearning constitutes a waste of time
    (E) The quality of a student’s notes book should be a factor in formulating the student’s  mark
    Ans:D
10  All of the following are appropriate areas for pupil teacher planning except
     (A) the day’s schedule
     (B) the selection of committees
     (C) the sequence in a skills programme
     (D) a class party
     (E) the selection of recreational reading
     Ans:C

Friday, 26 July 2013

MCQ's in Teaching Aptitude SET 1

1. The idea of Basic Education is propounded by—
   (A) Dr. Zakir Hussain
   (B) Dr. Rajendra Prasad
   (C) Mahatma Gandhi
   (D) Rabindranath Tagore
   Ans:C
2. The success of integrated education depends on—
   (A) The support of community
   (B) The excellence of text-books
   (C) The highest quality of teaching-learning material
   (D) The attitudinal changes in teachers
   Ans:B
3. Most important work of teacher is—
   (A) to organize teaching work
  (B) to deliver lecture in class
  (C) to take care of children
  (D) to evaluate the students
  Ans:A
4.Navodaya Schools have been established to—
  (A) increase number of school in rural areas
  (B) provide good education in rural areas
  (C) complete 'Sarva Shiksha Abhiyan'
  (D) check wastage of education in rural areas
  Ans:B
5. A teacher should be—
  (A) Honest
  (B) Dilligent
  (C) Dutiful
  (D) Punctual
  Ans:D
6. ‘Life long learning’ has developed because of:
  (A)Shortage of educational institutions
  (B)Requirement of educated people
  (C)Dynamics of knowledge explosion
  (D)Urge to learn more and more
  Ans:C
7. The most desirable outcome of higher education is:
  (A)Acquisition of higher order thinking skills
  (B)Training of individual
  (C)Acquisition of knowledge
  (D)Increase in academic achievement
  Ans:A
8. National Institute of Education is situated at:
  (A)Kolkata
  (B)Madras
  (C)Delhi
  (D)Mumbai
  Ans:C
9. Basic education is also known as:
  (A)New education policy
  (B)Wardha education plan
  (C)Essential education
  (D)Universal education
  Ans;B
10. A student tries to solve a problem without any help from a teacher. The teacher should:
  (A)Pay no attention to her/him
  (B)Scold him/her for foolishness
  (C)Offer help to solve his problem
  (D)Appraise his/her individual effort
  Ans:D

Wednesday, 24 July 2013

RDBMS Study Material Part II



KEY
A KEY is a value used to uniquely identify a record in a table. A KEY could be a single column or combination of multiple columns.
Primary key
A primary is a single column values used to uniquely identify a database record.
It has following attributes
  • A primary key cannot be NULL
  • A primary key value must be unique
  • The primary key values can not be changed
The primary key must be given a value when a new record is inserted.

Foreign Key

Foreign Key references primary key of another Table! It helps connect Tables  
  • A foreign key can have a different name from its primary key
  • It ensures rows in one table have corresponding rows in another
  • Unlike Primary key they do not have to be unique. Most often they aren’t.
  • Foreign keys can be null even though primary keys can not
Candidate key

 A candidate key is a combination of attributes that can be uniquely used to identify a database record without any extraneous data.

  • Each table may have one or more candidate keys.
  • One of these candidate keys is selected as the table primary key.

Database Dependencies/Functional Dependencies

A dependency occurs in a database when information stored in the same database table uniquely determines other information stored in the same table. You can also describe this as a relationship where knowing the values of one attribute (or a set of attributes) is enough to tell you the value of another attribute (or set of attributes) in the same table.

Saying that there is a dependency between attributes in a table is the same as saying that there is a functional dependency between those attributes. If there is a dependency in a database such that attribute B is dependent upon attribute A, you would write this as
 “A->B”.

For example, in a table listing employee characteristics including Social Security Number (SSN) and name, it can be said that name is dependent upon SSN (or SSN -> name) because an employee's name can be uniquely determined from their SSN. However, the reverse statement (name -> SSN) is not true because more than one employee can have the same name but different SSNs.

Trivial Functional Dependencies

A trivial functional dependency occurs when you describe a functional dependency of an attribute on a collection of attributes that includes the original attribute. For example, “{A, B} -> B” is a trivial functional dependency, as is “{name, SSN} -> SSN”. This type of functional dependency is called trivial because it can be derived from common sense. It is obvious that if you already know the value of B, then the value of B can be uniquely determined by that knowledge.

Full Functional Dependencies

A full functional dependency occurs when you already meet the requirements for a functional dependency and the set of attributes on the left side of the functional dependency statement cannot be reduced any farther. For example, “{SSN, age} -> name” is a functional dependency, but it is not a full functional dependency because you can remove age from the left side of the statement without impacting the dependency relationship.

Transitive Dependencies

Transitive dependencies occur when there is an indirect relationship that causes a functional dependency. For example, ”A -> C” is a transitive dependency when it is true only because both “A -> B” and “B -> C” are true.

Multivalued Dependencies

Multivalued dependencies occur when the presence of one or more rows in a table implies the presence of one or more other rows in that same table. For example, imagine a car company that manufactures many models of car, but always makes both red and blue colors of each model. If you have a table that contains the model name, color and year of each car the company manufactures, there is a multivalued dependency in that table. If there is a row for a certain model name and year in blue, there must also be a similar row corresponding to the red version of that same car.

Importance of Dependencies

Database dependencies are important to understand because they provide the basic building blocks used in database normalization. For example:
  • For a table to be in second normal form (2NF), there must be no case of a non-prime attribute in the table that is functionally dependendent upon a subset of a candidate key.
  • For a table to be in third normal form (3NF), every non-prime attribute must have a non-transitive functional dependency on every candidate key.
  • For a table to be in Boyce-Codd Normal Form (BCNF), every functional dependency (other than trivial dependencies) must be on a super key.
  • For a table to be in fourth normal form (4NF), it must have no multivalued dependencies.
The Data Definition Language (DDL)

Definition: The Data Definition Language (DDL) is one of two major components of the Structured Query Language (SQL). It is used to alter the structure of tables within a relational database. Some of the major commands comprising DML are CREATE TABLE, DROP TABLE and CREATE INDEX.

CREATE TABLE statement

A commonly used CREATE command is the CREATE TABLE command. The typical usage is:
CREATE [TEMPORARY] TABLE [table name] ([column definitions]) [table parameters].
For example, the command to create a table named employees with a few sample columns would be:
CREATE TABLE employees 
(
    id            INTEGER      PRIMARY KEY,
    first_name    VARCHAR(50)  NULL,
    last_name     VARCHAR(75)  NOT NULL,
    dateofbirth   DATE         NULL
);

DROP statements

Drop - To destroy an existing database, table, index, or view.
DROP objecttype objectname.
For example, the command to drop a table named employees would be:
DROP TABLE employees;
The DROP statement is distinct from the DELETE and TRUNCATE statements, in that DELETE and TRUNCATE do not remove the table itself. For example, a DELETE statement might delete some (or all) data from a table while leaving the table itself in the database, whereas a DROP statement would remove the entire table from the database.

ALTER statements

Alter - To modify an existing database object.
ALTER objecttype objectname parameters.
For example, the command to add (then remove) a column named bubbles for an existing table named sink would be:
ALTER TABLE sink ADD bubbles INTEGER;
ALTER TABLE sinks DROP COLUMN bubbles;

Referential integrity statements

Finally, another kind of DDL sentence in SQL is one used to define referential integrity relationships, usually implemented as primary key and foreign key tags in some columns of the tables.
These two statements can be included inside a CREATE TABLE or an ALTER TABLE sentence.
The Data Manipulation Language (DML)

The Data Manipulation Language (DML) is one of two major components of the Structured Query Language (SQL). It is used to insert, retrieve and modify data stored within relational databases. The major commands comprising DML are SELECT, INSERT, DELETE and UPDATE.

VIEWS
A view is a logical representation of another table or combination of tables. A view derives its data from the tables on which it is based. These tables are called base tables. Base tables might in turn be actual tables or might be views themselves. All operations performed on a view actually affect the base table of the view. You can use views in almost the same way as tables. You can query, update, insert into, and delete from views, just as you can standard tables.
Views can provide a different representation (such as subsets or supersets) of the data that resides within other tables and views. Views are very powerful because they allow you to tailor the presentation of data to different types of users.
There are two primary reasons to provide users with access to data through views rather than providing them with direct access to database tables:
  • Views provide simple, granular security. You can use a view to limit the data that a user is allowed to see in a table. For example, if you have an employees table and wish to provide some users with access to the records of full-time employees, you can create a view that contains only those records. This is much easier than the alternative (creating and maintaining a shadow table) and ensures the integrity of the data.
  • Views simplify the user experience. Views hide complex details of your database tables from end users who do not need to see them. If a user dumps the contents of a view, they won’t see the table columns that aren’t selected by the view and they might not understand. This protects them from the confusion caused by poorly named columns, unique identifiers and table keys.

Creating a View

Creating a view is quite straightforward: you simply need to create a query that contains the restrictions you wish to enforce and place it inside the CREATE VIEW command. Here’s the syntax:
CREATE VIEW viewname AS
<query>
For example, if you wish to create the full-time employees view you would issue the following command:
CREATE VIEW fulltime AS
SELECT first_name, last_name, employee_id
FROM employees
WHERE status='FT'

Modifying a View

Changing the contents of a view uses the exact same syntax as the creation of a view, but you use the ALTER VIEW command instead of the CREATE VIEW command. For example, if you wanted to add a restriction to the fulltime view that adds the employee’s telephone number to the results, you would issue the following command:
ALTER VIEW fulltime AS
SELECT first_name, last_name, employee_id, telephone
FROM employees
WHERE status='FT'

Deleting a View

It’s simple to remove a view from a database using the DROP VIEW command. For example, if you wish to delete the full-time employees view, you would use the following command:
DROP VIEW fulltime

INDEXES

An index is a database feature used for locating data quickly within a table. Indexes are defined by selecting a set of commonly searched attribute(s) on a table and using the appropriate platform-specific mechanism to create an index.

Examples:
Personnel information may be store in a Human Resource department's employee table. Clerks find that they often search the table for employees by last name but get slow query responses. Defining an index on the table consisting of the last name attribute would speed up these queries.

Synonyms

A synonym is an alternative name for objects such as tables, views, sequences, stored procedures, and other database objects.

Creating or replacing a synonym

The syntax for creating a synonym is:
create [or replace] [public] synonym [schema .] synonym_name
  for [schema .] object_name [@ dblink];
The or replace phrase allows you to recreate the synonym (if it already exists) without having to issue a DROP synonym command.
The public phrase means that the synonym is a public synonym and is accessible to all users. Remember though that the user must first have the appropriate privileges to the object to use the synonym.
The schema phrase is the appropriate schema. If this phrase is omitted, Oracle assumes that you are referring to your own schema.
The object_name phrase is the name of the object for which you are creating the synonym. It can be one of the following:
  • table
  • view
  • sequence
  • stored procedure
  • function
  • package
  • materialized view
  • java class schema object
  • user-defined object
  • synonym

For Example

create public synonym suppliers
for app.suppliers;
This first example demonstrates how to create a synonym called suppliers. Now, users of other schemas can reference the table called suppliers without having to prefix the table name with the schema named app. For example:
select * from suppliers;
If this synonym already existed and you wanted to redefine it, you could always use the or replace phrase as follows:
create or replace public synonym suppliers
for app.suppliers;

Dropping a synonym

It is also possible to drop a synonym. The syntax for dropping a synonym is:
drop [public] synonym [schema .] synonym_name [force];
The public phrase allows you to drop a public synonym. If you have specified public, then you don't specify a schema.
The force phrase will force Oracle to drop the synonym even if it has dependencies. It is probably not a good idea to use the force phrase as it can cause invalidation of Oracle objects.

For Example

drop public synonym suppliers;
This drop statement would drop the synonym called suppliers that we defined earlier.

Data Dictionary

The data dictionary is where the RDBMS stores the logical and physical structure of the database; e.g. the objects in the database, the structure of your tables, where the data files are, which extents are used by which segments, what constraints exist, and so on.

Sequences

A sequence is a database object that generates numbers in sequential order. Applications most often use these numbers when they require a unique value in a table such as primary key values. Some database management systems use an "auto number" concept or "auto increment" setting on numeric column types. Both the auto numbering columns and sequences provide a unique number in sequence used for a unique identifier. The following list describes the characteristics of sequences:
·          Sequences are available to all users of the database
·          Sequences are created using SQL statements (see below)
·          Sequences have a minimum and maximum value (the defaults are minimum=0 and maximum=263-1); they can be dropped, but not reset
·          Once a sequence returns a value, the sequence can never return that same value
·          While sequence values are not tied to any particular table, a sequence is usually used to generate values for only one table
·          Sequences increment by an amount specified when created (the default is 1)

Creating a Sequence

To create sequences, execute a CREATE SEQUENCE statement in the same way as an UPDATE or INSERT statement. The sequence information is stored in a data dictionary file in the same location as the rest of the data dictionary files for the database. If the data dictionary file does not exist, the SQL engine creates the file when it creates the first sequence. In legacy dictionaries, the new file name is SEQUENCE.DD. The format of this file remains proprietary and subject to change, so do not depend on the record layout or format of the data. In Journaled Filesystem databases, this information is also proprietary and subject to change.
The format for a CREATE SEQUENCE statement is as follows:
CREATE SEQUENCE sequence_name
 [INCREMENT BY #]
 [START WITH #]
 [MAXVALUE # | NOMAXVALUE]
 [MINVALUE # | NOMINVALUE]
 [CYCLE | NOCYCLE]
Variable
Description
INCREMENT BY
The increment value. This can be a positive or negative number.
START WITH
The start value for the sequence.
MAXVALUE
The maximum value that the sequence can generate. If specifying NOMAXVALUE, the maximum value is 263-1.
MINVALUE
The minimum value that the sequence can generate. If specifying NOMINVALUE, the minimum value is -263.
CYCLE
Specify CYCLE to indicate that when the maximum value is reached the sequence starts over again at the start value. Specify NOCYCLE to generate an error upon reaching the maximum value.

Dropping a Sequence

To drop a sequence, execute a DROP SEQUENCE statement. Use this function when a sequence is no longer useful, or to reset a sequence to an older number. To reset a sequence, first drop the sequence and then recreate it.
Drop a sequence following this format:
DROP SEQUENCE my_sequence

Using a Sequence

Use sequences when an application requires a unique identifier. INSERT statements, and occasionally UPDATE statements, are the most common places to use sequences. Two "functions" are available on sequences:
NEXTVAL: Returns the next value from the sequence.
CURVAL: Returns the value from the last call to NEXTVAL by the current user during the current connection. For example, if User A calls NEXTVAL and it returns 124, and User B immediately calls NEXTVAL getting 125, User A will get 124 when calling CURVAL, while User B will get 125 while calling CURVAL. It is important to understand the connection between the sequence value and a particular connection to the database. The user cannot call CURVAL until making a call to NEXTVAL at least once on the connection. CURVAL returns the current value returned from the sequence on the current connection, not the current value of the sequence.

Examples

To create the sequence:
CREATE SEQUENCE customer_seq INCREMENT BY 1 START WITH 100
To use the sequence to enter a record into the database:
INSERT INTO customer (cust_num, name, address)
VALUES (customer_seq.NEXTVAL,
'John Doe', '123 Main St.')
To find the value just entered into the database:
SELECT customer_seq.CURVAL AS LAST_CUST_NUM

RDBMS Study Material Part 1



Relational database design and SQL
E-R Diagram and their transformation to relation design, normalization -INF, 2NF and BCNF.
SQL: Data definition language (DDL) Data manipulation language (DML), Data control language (DCL) commands database objects like. Views indexes, sequences, synonyms, data dictionary.
Entity Relationship Modeling
An entity-relationship (ER) diagram is a specialized graphic that illustrates the relationships between entities in a database. ER diagrams often use symbols to represent three different types of information. Boxes are commonly used to represent entities. Diamonds are normally used to represent relationships and ovals are used to represent attributes.
An Entity is a thing or object in real world that is distinguishable from surrounding environment. For example each employee of an organization is a separate entity. Normally, each entity is stored in a database table and every instance of an entity corresponds to a row in that table. In an ER diagram, each entity is depicted as a rectangular box with the name of the entity contained within it.

A database containing information about individual people would likely have an entity called Person. This would correspond to a table with the same name in the database and every person tracked in the database would be an instance of that Person entity and have a corresponding row in the Person table. Database designers creating an E-R diagram would draw the Person entity using a shape similar to this:

Databases contain information about each entity. This information is tracked in individual fields known as attributes, which normally correspond to the columns of a database table.
For example, the Person entity might have attributes corresponding to the person's first and last name, date of birth, and a unique person identifier. Each of these attributes is depicted in an E-R diagram as an oval, as shown in the figure below:



Each attribute can have Values. In most cases single attribute have one value. But it is possible for attributes have multiple values also. Entities can have relationships with each other. In Entity Relationship Modeling, we model entities, their attributes and relationships among entities.

Relationships and Cardinality

The power of the E-R diagram lies in its ability to accurately display information about the relationships between entities. For example, we might track information in our database about the city where each person lives. Information about the city itself is tracked within a City entity and a relationship is used to tie together Person and City instances.

Relationships are normally given names that are verbs, while attributes and entities are named after nouns. This convention makes it easy to express relationships. For example, if we name our Person/City relationship "Lives In", we can string them together to say "A person lives in a city." We express relationships in E-R diagrams by drawing a line between the related entities and placing a diamond shape that contains the relationship name in the middle of the line.
There are some additional shapes on the line. The double hashed line appearing just to the left of the City entity indicates that this part of the relationship has a cardinality of 1. On the other hand, the crow's foot symbol to the right of the Person entity indicates that this part of the relationship has a cardinality of "many". Stated more plainly, each person may live in only one city, while a city may contain many people.


Types of Database Relationships

There are three different types of database relationships, each named according to the number of table rows that may be involved in the relationship. Each of these three relationship types exists between two tables.
  • One-to-one relationships occur when each entry in the first table has one, and only one, counterpart in the second table. One-to-one relationships are rarely used because it is often more efficient to simply put all of the information in a single table.
  • One-to-many relationships are the most common type of database relationship. They occur when each record in the first table corresponds to one or more records in the second table but each record in the second table corresponds to only one record in the first table. For example, the relationship between a Teachers table and a Students table in an elementary school database would likely be a one-to-many relationship, because each student has only one teacher, but each teacher may have multiple students.
  • Many-to-many relationships occur when each record in the first table corresponds to one or more records in the second table and each record in the second table corresponds to one or more records in the first table. For example, the relationship between a Teachers and a Courses table would likely be many-to-many because each teacher may instruct more than one course and each course may have more than one instructor.

Normalization

Normalization is the process of efficiently organizing data in a database. There are two goals of the normalization process: eliminating redundant data (for example, storing the same data in more than one table) and reducing data dependencies (only storing related data in a table). Both of these are worthy goals as they reduce the amount of space a database consumes and ensure that data is logically stored.

The Normal Forms

The database community has developed a series of guidelines for ensuring that databases are normalized. These are referred to as normal forms, and they are first normal form (1NF), second normal form (2NF), and third normal form (3NF) along with the occasional 4NF.

First Normal Form (1NF)

First normal form (1NF) sets the very basic rules for an organized database:
  • Eliminate duplicative columns from the same table.
  • Create separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key).
The first rule dictates that we must not duplicate data within the same row of a table. Within the database community, this concept is referred to as the atomicity of a table. Tables that comply with this rule are said to be atomic.

Second Normal Form (2NF)

Second normal form (2NF) further addresses the concept of removing duplicative data:
  • Meet all the requirements of the first normal form.
  • Remove subsets of data that apply to multiple rows of a table and place them in separate tables.
  • Create relationships between these new tables and their predecessors through the use of foreign keys.
These rules can be summarized in a simple statement: 2NF attempts to reduce the amount of redundant data in a table by extracting it, placing it in new table(s) and creating relationships between those tables.


Third Normal Form (3NF)

Third normal form (3NF) goes one large step further:
  • Meet all the requirements of the second normal form.
  • Remove columns that are not dependent upon the primary key.( Has no transitive functional dependencies)

Boyce-Codd Normal Form (BCNF or 3.5NF)

The Boyce-Codd Normal Form also referred to as the "third and half (3.5) normal form", adds one more requirement:
  • Meet all the requirements of the third normal form.
  • Every determinant must be a candidate key.

Fourth Normal Form (4NF)

Finally, fourth normal form (4NF) has one additional requirement:
  • Meet all the requirements of the third normal form.
  • A relation is in 4NF if it has no multi-valued dependencies.
Remember, these normalization guidelines are cumulative. For a database to be in 2NF, it must first fulfill all the criteria of a 1NF database.