Computer Sciene of Udayana State University

April 26, 2009

General Definitions of 2NF and 3NF

Filed under: Computer Science — ignaga @ 2:03 AM
  • Based on candidate keys (not only primary keys)
  • Second normal form (2NF)

A relation that is in 1NF and every non-prime attribute is fully functionally dependent on any candidate key.

  • Third normal form (3NF)

A relation that is in 1NF and 2NF and in which no non-prime attribute is transitively dependent on any candidate key.

  • These definitions may find hidden redundancies.

Advertisements

Boyce–Codd Normal Form (BCNF)

Filed under: Computer Science — ignaga @ 1:51 AM

· Based on functional dependencies that take into account all candidate keys in a relation, however BCNF also has additional constraints compared with general definition of 3NF.

· BCNF – A relation is in BCNF if and only if every determinant is a candidate key.

· Difference between 3NF and BCNF is that for a functional dependency A –> B, 3NF allows this dependency in a relation if B is a primary-key attribute and A is not a candidate key.

· Whereas, BCNF insists that for this dependency to remain in a relation, A must be a candidate key.

· Every relation in BCNF is also in 3NF. However, relation in 3NF may not be in BCNF.

teach

  • Two FDs exist in the relation TEACH:

fd1: { student, course} à instructor

fd2: instructor à course

  • {student, course} is a candidate key for this relation and that the dependencies shown follow the pattern in Figure 10.12 (b).

So this relation is in 3NF but not in BCNF

  • A relation NOT in BCNF should be decomposed so as to meet this property, while possibly forgoing the preservation of all functional dependencies in the decomposed relations.
  • Main steps of algorithm 11.3:

Find the FD XàY in Q that violates BCNF

Replace Q by two relations with schemas (Q-Y) and (X,Y).

TEACH relation is decomposed into:

  • T1(instructor, course)
  • T2(instructor, student)

FD fd1 is lost after decomposition.

Fourth Normal Form (4NF) – MVD

Filed under: Computer Science — ignaga @ 1:23 AM

· MVD is a dependency caused

in most cases by having several multi-valued attributes in an 1NF relation.

Or, when a determinant, for example A, determines several sets of values (e.g. B and C) as shown below.1

  • MVD between attributes A, B, and C in a relation using the following notation:

A –> B

A –> C

2

· MVD can be further defined as being trivial or nontrivial.

MVD A –> B in relation R is defined as being trivial if (a) B is a subset of A or (b) A U B = R.

MVD is defined as being nontrivial if neither (a) nor (b) are satisfied.

Trivial MVD does not specify a constraint on a relation, while a nontrivial MVD does specify a constraint



Defined as a relation that is in BCNF and contains no nontrivial MVDs.

BranchNo –> Sname

BranchNo –> Oname

Decompose BranchStaffOwner into two tables

3

42

Fifth Normal Form (5NF)

Filed under: Computer Science — ignaga @ 1:18 AM

A relation that has no join dependency

fifth-normal-form

fifth-normal-form

5NF – Example

Filed under: Computer Science — ignaga @ 1:11 AM

Eliminate join dependency by decomposing the relation into three relations:

example-5-nf

example-5-nf

Performing join on 2 relations produce spurious tables
Performing the join on all 3 relations will produce the original relation

April 18, 2009

Database(ERD Quiz)

Filed under: Computer Science — ignaga @ 11:59 AM

A database is a structured collection of records or data that is stored in a computer system. The structure is achieved by organizing the data according to a database model. The model in most common use today is the relational model. Other models such as the hierarchical model and the network model use a more explicit representation of relationships.

Database management systems

Filed under: Computer Science — ignaga @ 11:58 AM

A computer database relies on software to organize the storage of data. This software is known as a database management system (DBMS). Database management systems are categorized according to the database model that they support. The model tends to determine the query languages that are available to access the database. A great deal of the internal engineering of a DBMS, however, is independent of the data model, and is concerned with managing factors such as performance, concurrency, integrity, and recovery from hardware failures. In these areas there are large differences between products.

A Relational Database Management System (RDBMS) implements the features of the relational model outlined above. In this context, Date‘s “Information Principle” states: “the entire information content of the database is represented in one and only one way. Namely as explicit values in column positions (attributes) and rows in relations (tuples). Therefore, there are no explicit pointers between related tables.”

Bit

Filed under: Computer Science — ignaga @ 11:57 AM

A bit is a binary digit, taking a value of either 0 or 1. Binary digits are a basic unit of information storage and communication in digital computing and digital information theory. Information theory also often uses the natural digit, called either a nit or a nat. Quantum computing also uses qubits, a single piece of information with a probability of being true.

The bit is also a unit of measurement, the information capacity of one binary digit. It has the symbol bit or b, the latter recommended by IEEE 1541-2002.

Byte

Filed under: Computer Science — ignaga @ 11:55 AM

A byte (pronounced /ˈbaɪt/) is a basic unit of measurement of information storage in computer science. In many computer architectures it is a unit of memory addressing. There is no standard but a byte most often consists of eight bits.

A byte is an ordered collection of bits, with each bit denoting a single binary value of 1 or 0. The byte most often consists of 8 bits in modern systems; however, the size of a byte can vary and is generally determined by the underlying computer operating system or hardware. Historically, byte size was determined by the number of bits required to represent a single character from a Western character set. Its size was generally determined by the number of possible characters in the supported character set and was chosen to be a divisor of the computer’s word size. Historically bytes have ranged from five to twelve bits

Field

Filed under: Computer Science — ignaga @ 11:48 AM
Filed

Filed

Fields can be one of a range of different data types, including: Text, Integer, Real number, Yes/No (Boolean), Date, Time, Sound, and Video.

Key fields allow computers to uniquely identify each record. They contain a unique value for each record. The records in a file are usually sorted by the value of the key field, for example, the ProductID in a stock file.

Each field can only hold one data type at any time. e.g. a field for a date will always, and only, hold a date. Fields can be either fixed or variable in length.

Fixed length fields will always use a certain number of characters for each record. Variable length fields only use the minimum number of characters necessary for each record.

Fixed length fields are faster to search through, but variable length fields use less storage space.

« Previous PageNext Page »

Blog at WordPress.com.