0% found this document useful (0 votes)
387 views5 pages

Database Concepts A) Indexing: CREATE INDEX Index - Name ON Table - Name (Column - Name)

This document provides an overview of several key database concepts: 1) Indexing allows for faster searching of records by sorting data in alphabetical order based on indexed columns like last name, but requires recalculation on modifications. Indexes are recommended on frequently searched where clause columns. 2) Different types of keys like candidate keys that uniquely identify rows and composite keys that combine multiple columns. Primary keys must be a candidate key. 3) Normalization removes data redundancies through table decomposition, eliminating anomalies and easier data handling/updating. Denormalization reintroduces some redundancy to optimize reads.

Uploaded by

Haroon Ashraf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
387 views5 pages

Database Concepts A) Indexing: CREATE INDEX Index - Name ON Table - Name (Column - Name)

This document provides an overview of several key database concepts: 1) Indexing allows for faster searching of records by sorting data in alphabetical order based on indexed columns like last name, but requires recalculation on modifications. Indexes are recommended on frequently searched where clause columns. 2) Different types of keys like candidate keys that uniquely identify rows and composite keys that combine multiple columns. Primary keys must be a candidate key. 3) Normalization removes data redundancies through table decomposition, eliminating anomalies and easier data handling/updating. Denormalization reintroduces some redundancy to optimize reads.

Uploaded by

Haroon Ashraf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Database Concepts

a) Indexing
Indexes are like a dictionary. Suppose there is table like the following with PK, FIRST NAME, LAST NAME,
INDEX. We will create index with last name. So the table will look like the second one for SQL
1 Hari Abhi 2
2 Sheri Mani 1
3 Eld Raj 4
4 Mary Shaji 3

Now Sql can easily search records with last name as they are sorted in alphabetical order. But if there is
any change in record I e modification indexing has to be recalculated. So its expensive for modification
but easy for searching.
When to use indexes:-
Always select an index on column that appears in Where clause of the query.
Only on columns having a high unique number
Avoid indexes on small tables , not highly unique , columns that are not frequently updated ,
large composite index can be costly.
Clustered Index Data stored in the order of index (PK), Un-clustered Opposite of clustered
To create index:- CREATE INDEX index_name ON table_name (column_name)
Keys
Candidate key are the keys which are eligible to be PK.
Primary key is a candidate key that is most appropriate to become main key of the table. From super
key u can remove some fields still it can identify that row. For candidate key if u remove some attributes
it will not identify that row. So candidate key is the subset of the super key.
Composite key is combination of more than one column that uniquely identifies a row.


1 Sheri Mani 2
2 Hari Abhi 1
3 Mary Shaji 4
4 Eld Raj 3

Normalization
Normalization is the process of decomposing tables for eliminating redundancies from database. It will
remove data anomalies. Not normal to have attributed values repeated in database. It becomes difficult
to handle and update the database. Suppose there is a student table with two rows having same names

First NF








Second NF























Third NF







SQL Queries
http://www.studytonight.com/dbms/like-clause.php

SQL Constraints
http://www.studytonight.com/dbms/sql-constraints

Joints
http://www.studytonight.com/dbms/joining-in-sql

Denormalization
In computing, denormalization is the process of attempting to optimize the read performance of
a database by adding redundant data or by grouping data..

You might also like