Sei sulla pagina 1di 42

Normalization

• A repeating group is an attribute that has more than one value in


each row of a table.
• Partial Functional Dependency occurs only in relation with composite keys.
Partial functional dependency occurs when one or more non key attribute
are depending on a part of the primary key.
• Example:
• Table: Stud_id, Course_id, Stud_name, Course_Name
• Where: Primary Key = Stud_id + Course_id
• Then: To determine name of student we use only Stud_id, which is part of
primary key.
• {Stud_id} -> {Stud_Name}
• Hence,Stud_name is partially dependent on Stud_id. This is called partial
dependency.
• In the above table, we have partial dependency; let us see how:
• The prime key attributes are StudentID and ProjectNo
• StudentName and ProjectName should be functionally dependent on
part of a candidate key, to be Partial Dependent.
• The StudentName can be determined by StudentID, which makes the
relation Partial Dependent.
• The ProjectName can be determined by ProjectNo, which makes the
relation Partial Dependent.
• removing Partial Dependency
Transitive dependency
• Transitive dependency is nothing but, a non-prime attribute( other
than candidate key) depending on another non-prime
attribute which is entirely dependent on candidate key.
Unnormalized
1NF
2NF
3NF
• Another example DREAm House
Normalize the following Relation (1nf,2nf,3nf)
• A particular language that has emerged from the development of the
relational model is the Structured Query Language
• In 1986, a standard for SQL was defined by the American National
Standards Institute (ANSI), which was subsequently adopted in 1987
as an international standard by the International Organization for
Standardization (ISO, 1987).
• More than one hundred Database Management Systems now
support SQL, running on various hardware platforms from PCs to
mainframes.
Objectives of SQL
• a database language should allow a user to:
• create the database and relation structures;
• perform basic data management tasks, such as the insertion,
modification, and deletion of data from the relations;
• perform both simple and complex queries.
• SQL is an example of a transform-oriented language, or a language
designed to use relations to transform inputs into required outputs.
• DDL is short name of Data Definition Language, which deals with database
schemas and descriptions, of how the data should reside in the database.
• CREATE - to create a database and its objects like (table, index, views, store
procedure, function, and triggers)
• ALTER - alters the structure of the existing database
• DROP - delete objects from the database
• TRUNCATE - remove all records from a table, including all spaces allocated
for the records are removed
• COMMENT - add comments to the data dictionary
• RENAME - rename an object
• DML is short name of Data Manipulation Language which deals with
data manipulation and includes most common SQL statements such
SELECT, INSERT, UPDATE, DELETE, etc., and it is used to store, modify,
retrieve, delete and update data in a database.
• SELECT - retrieve data from a database
• INSERT - insert data into a table
• UPDATE - updates existing data within a table
• DELETE - Delete all records from a database table
• DCL is short name of Data Control Language which includes
commands such as GRANT and mostly concerned with rights,
permissions and other controls of the database system.
• GRANT - allow users access privileges to the database
• REVOKE - withdraw users access privileges given by using the GRANT
command
view
• A view is a virtual relation that does not
• necessarily exist in the database but can be produced upon request
by a
• particular user, at the time of request.

Potrebbero piacerti anche