Vous êtes sur la page 1sur 4

Q: What are the definitions of the following items?

COLUMN,
RECORD,
TABLE,
ITEM,
FIELD,
ELEMENT,
PRIMARY KEY,
FOREIGN KEY, and
DATATYPE.

A: A column is a smallest unit in a database that you need


to deal with. A record is a collection of columns and a table
is a collection of records. The terms: elements, columns,
fields and items can be used interchangeably. A primary
key is a unique identifier in a table. A foreign key is a
column in a table (child) that references to a primary key
column in another table (parent). Relationships between two
tables are normally established by defining primary or
foreign keys. A data type is a format that an input data will
be stored in a column.

Q: What is the relationship between primary and


foreign keys?

A: Relationships between two tables are normally


established by defining primary or foreign keys. It will
establish a child and parent relationships. A foreign key is a
column in a table (child) that references to a primary key
column in another table (parent).

Q: Describe the Entity Relationship diagram and


Logical Data Model.

A: "Entity Relationship Diagram" or "Logical Data Model" is


used to establish relationships between entities.

Q: What is a composite index?


A: If an index key or a primary key were composed of
more than one column. We call it a composite index.

Q: What is a Database?

A: A collection of all tables under a single or many different


schemas can be stored and maintained in a database. A
database, in effect, is a collection of objects such as tables,
indexes, stored procedures, etc.

Q: What is an inner join or equi-join?

A: Joining two or more tables together using the


WHERE clause with the equal sign (=) in a query. This type
of query will retrieve records that have exact match and will
be called inner join or equi-join.

Q: What is an outer join?

A: Joining two or more tables using OUTER join, not only


you retrieve all matching records but also you retrieve the
records that do not match.

Q: What is a self join?

A: When a table refers to itself in the WHERE clause, we


call that join is a self-join.

Q: What do the OUTER JOIN, RIGHT OUTER JOIN,


LEFT OUTER JOIN, and FULL OUTER JOIN syntax in the
Oracle SQL statement?

A: We use the OUTER option when we want all records that


have exact match plus those records that have no match.

Q: How can you perform the FULL OUTER JOIN


syntax using the Original Oracle syntax?
A: Although it is possible but it is very difficult to perform
the full outer join using the original Oracle syntax.

What is Normalization? What are the types of


Normalization?

The formal classifications describing the level of database


normalization in a data model are called Normal Forms (NF)
and the process of doing this is Normalization.

First normal form (1NF) lays the groundwork for an


organized database design:

Ensure that each table has a primary key: minimal set of


attributes which can uniquely identify a record.

Eliminate repeating groups (categories of data which would


seem to be required a different number of times on different
records) by defining keyed and non-keyed attributes
appropriately.

Atomicity: Each attribute must contain a single value, not a


set of values.

'First normal form' depends on functional dependency


formula f(x)=y. For every value of x there is value for y.

Second normal form (2NF) If a table has a composite key,


all attributes must be related to the whole key:

The database must meet all the requirements of the first


normal form.

The relational schema should not have any partial functional


dependency i.e. No proper subset of the primary key should
derive a functional dependency belonging to the same
schema. For example, consider functional dependencies FD:
{AB->C, A->D, C->D} here AB is the primary key, as A->D
this relational schema is not in 2NF.

Third normal form (3NF) requires that data stored in a


table be dependent only on the primary key, and not on any
other field in the table.

The database must meet all the requirements of the first


and second normal form.

All fields must be directly dependent on the primary key


field. Any field which is dependent on a non-key field which
is in turn dependent on the Primary Key (ie a transitive
dependency) is moved out to a separate database table

Vous aimerez peut-être aussi