Database:
A database is a collection of related data which represents some aspect of the real world. A database system is designed to be built and populated with data for a certain task.
Database Management System (DBMS)
Database Management System (DBMS) is a software for storing and retrieving users’ data while considering appropriate security measures. It consists of a group of programs which manipulate the database. The DBMS accepts the request for data from an application and instructs the operating system to provide the specific data. In large systems, a DBMS helps users and other
third-party software to store and retrieve data.
Database management systems were developed to handle the following difficulties of typical File-processing systems supported by conventional operating systems.
- Data redundancy and inconsistency
- Difficulty in accessing data
- Data isolation – multiple files and formats
- Integrity problems
- Atomicity of updates
- Concurrent access by multiple users
- Security problems
ER diagram:
- ER diagram or Entity Relationship diagram is a conceptual model that gives the graphical representation of the logical structure of the database.
- It shows all the constraints and relationships that exist among the different components.
- An ER diagram is mainly composed of following three components- Entity Sets, Attributes and Relationship Set.

- Roll_no is a primary key that can identify each entity uniquely.
- Thus, by using a student’s roll number, a student can be identified uniquely.
Entity Set:
An entity set is a set of the same type of entities.
- Strong Entity Set:
- A strong entity set is an entity set that contains sufficient attributes to uniquely identify all its entities.
- In other words, a primary key exists for a strong entity set.
- Primary key of a strong entity set is represented by underlining it.
- Weak Entity Set:
- A weak entity set is an entity set that does not contain sufficient attributes to uniquely identify its entities.
- In other words, a primary key does not exist for a weak entity set.
- However, it contains a partial key called a discriminator.
- Discriminator can identify a group of entities from the entity set.
- Discriminator is represented by underlining with a dashed line.
Relationship:
A relationship is defined as an association among several entities.
- Unary Relationship Set – Unary relationship set is a relationship set where only one entity set participates in a relationship set.
- Binary Relationship Set – Binary relationship set is a relationship set where two entity sets participate in a relationship set.
- Ternary Relationship Set – Ternary relationship set is a relationship set where three entity sets participate in a relationship set.
- N-ary Relationship Set – N-ary relationship set is a relationship set where ‘n’ entity sets participate in a relationship set.
Cardinality Constraint:
Cardinality constraint defines the maximum number of relationship instances in which an entity can participate.
● One-to-One Cardinality – An entity in set A can be associated with at most one entity in set B. An entity in set B can be associated with at most one entity in set A.
● One-to-Many Cardinality – An entity in set A can be associated with any number (zero or more) of entities in set B. An entity in set B can be associated with at most one entity in set A.
● Many-to-One Cardinality – An entity in set A can be associated with at most one entity in set B. An entity in set B can be associated with any number of entities in set A.
●Many-to-Many Cardinality – An entity in set A can be associated with any number (zero or more) of entities in set B. An entity in set B can be associated with any number (zero or more) of entities in set A.
Attributes:
Attributes are the descriptive properties which are owned by each entity of an Entity Set.
Types of Attributes:
- Simple Attributes – Simple attributes are those attributes which cannot be divided further.
Ex. Age - Composite Attributes – Composite attributes are those attributes which are composed of many other simple attributes.
Ex. Name, Address - Multi Valued Attributes – Multi valued attributes are those attributes which can take more than one value for a given entity from an entity set.
Ex. Mobile No, Email ID. - Derived Attributes – Derived attributes are those attributes which can be derived from other attribute(s).
Ex. Age can be derived from DOB. - Key Attributes – Key attributes are those attributes which can identify an entity uniquely in an entity set.
Ex. Roll No.
Constraints:
Relational constraints are the restrictions imposed on the database contents and
operations. They ensure the correctness of data in the database.
● Domain Constraint – Domain constraint defines the domain or set of values for an attribute. It specifies that the value taken by the attribute must be the atomic value from its domain.
● Tuple Uniqueness Constraint – Tuple Uniqueness constraint specifies that all the tuples must be necessarily unique in any relation.
● Key Constraint – All the values of the primary key must be unique. The value of the primary key must not be null.
● Entity Integrity Constraint – Entity integrity constraint specifies that no attribute of primary key must contain a null value in any relation.
● Referential Integrity Constraint – It specifies that all the values taken by the foreign key must either be available in the relation of the primary key or be null.
Closure of an Attribute Set:
The set of all those attributes which can be functionally determined from an attribute set is called a closure of that attribute set.
Keys: A key is a set of attributes that can identify each tuple uniquely in the given relation.
Types Of Keys:
- Super Key – A superkey is a set of attributes that can identify each tuple uniquely in the given relation. A super key may consist of any number of attributes.
- Candidate Key – A set of minimal attribute(s) that can identify each tuple uniquely in the given relation is called a candidate key.
- Primary Key – A primary key is a candidate key that the database designer selects while designing the database. Primary Keys are unique and NOT NULL.

- Alternate Key – Candidate keys that are left unimplemented or unused after implementing the primary key are called as alternate keys.
- Foreign Key – An attribute ‘X’ is called as a foreign key to some other attribute ‘Y’ when its values are dependent on the values of attribute ‘Y’. The relation in which attribute ‘Y’ is present is called as the referenced relation. The relation in which attribute ‘X’ is present is called as the referencing relation.
- Composite Key – A primary key composed of multiple attributes and not just a single attribute is called a composite key.
- Unique Key – It is unique for all the records of the table. Once assigned, its value cannot be changed i.e. it is non-updatable. It may have a NULL value.
Functional Dependency:
In any relation, a functional dependency α → β holds if- Two tuples having same value of attribute α also have same value for attribute β.
Types of Functional Dependency:
1.Trivial Functional Dependencies –
A functional dependency X → Y is said to be trivial if and only if Y ⊆ X. o Thus, if RHS of a functional dependency is a subset of LHS, then it is called a trivial functional dependency.
2. Non-Trivial Functional Dependencies –
A functional dependency X → Y is said to be non-trivial if and only if Y ⊄ X. o Thus, if there exists at least one attribute in the RHS of a functional dependency that is not a part of LHS, then it is called a non-trivial functional dependency.
Decomposition of a Relation:
The process of breaking up or dividing a single relation into two or more sub relations is called the decomposition of a relation.
Properties of Decomposition:
● Lossless Decomposition - Lossless decomposition ensures no information is lost from the original relation during decomposition. When
the sub relations are joined back, the same relation is obtained that was
decomposed.
● Dependency Preservation - Dependency preservation ensures None of the functional dependencies that hold on the original relation are lost. The sub relations still hold or satisfy the functional dependencies of the original
relation.
Types of Decomposition:
1.Lossless Join Decomposition:
- Consider there is a relation R which is decomposed into sub relations R1, R2, ….,Rn.
- This decomposition is called lossless join decomposition when the join of the sub relations results in the same relation R that was decomposed.
- For lossless join decomposition, we always have- R1 ⋈ R2 ⋈ R3 ……. ⋈ Rn = R where ⋈ is a natural join operator
2. Lossy Join Decomposition:
- Consider there is a relation R which is decomposed into sub relations R1, R2, ….,Rn.
- This decomposition is called lossy join decomposition when the join of the sub relations does not result in the same relation R that was decomposed.
- For lossy join decomposition, we always have- R1 ⋈ R2 ⋈ R3 ……. ⋈ Rn ⊃ R where ⋈ is a natural join operator
Normalization:
In DBMS, database normalization is a process of making the database consistent by-
● Reducing the redundancies
● Ensuring the integrity of data through lossless decomposition
Normal Forms:
- First Normal Form (1NF) – A given relation is called in First Normal Form (1NF) if each cell of the table contains only an atomic value i.e. if the attribute of every tuple is either single valued or a null value.
- Second Normal Form (2NF) – A given relation is called in Second Normal Form (2NF) if and only if
- Relation already exists in 1NF.
- No partial dependency exists in the relation.
A → B is called a partial dependency if and only if- A is a subset of some candidate key and B is a non-prime attribute.
- Third Normal Form (3NF) – A given relation is called in Third Normal Form (3NF) if and only if
- Relation already exists in 2NF.
- No transitive dependency exists for non-prime attributes.
A → B is called a transitive dependency if and only if- A is not a super key and B is a non-prime attribute.
- Boyce-Codd Normal Form – A given relation is called in BCNF if and only if
- Relation already exists in 3NF.
- For each non-trivial functional dependency ‘A → B’, A is a super key of the relation.

Transaction: Transaction is a single logical unit of work formed by a set of operations.
Operations in Transaction:
● Read Operation – Read(A) instruction will read the value of ‘A’ from the database and will store it in the buffer in main memory.
● Write Operation – Write(A) will write the updated value of ‘A’ from the buffer to the database.
Transaction States:
- Active State –
- This is the first state in the life cycle of a transaction.
- A transaction is called in an active state as long as its instructions are getting executed.
- All the changes made by the transaction now are stored in the buffer in main memory.
- Partially Committed State –
- After the last instruction of the transaction has been executed, it enters into a partially committed state.
- After entering this state, the transaction is considered to be partially committed.
- It is not considered fully committed because all the changes made by the transaction are still stored in the buffer in main memory.
- Committed State –
- After all the changes made by the transaction have been successfully stored into the database, it enters into a committed state.
- Now, the transaction is considered to be fully committed.
- Failed State –
- When a transaction is getting executed in the active state or partially committed state and some failure occurs due to which it becomes impossible to continue the execution, it enters into a failed state.
- Aborted State –
- After the transaction has failed and entered into a failed state, all the changes made by it have to be undone.
- To undo the changes made by the transaction, it becomes necessary to roll back the transaction.
- After the transaction has rolled back completely, it enters into an aborted state.
- Terminated State –
- This is the last state in the life cycle of a transaction.
- After entering the committed state or aborted state, the transaction finally enters into a terminated state where its life cycle finally comes to an end.
ACID Properties:
To ensure the consistency of the database, certain properties are followed by all the transactions occurring in the system. These properties are called as ACID Properties of a transaction.
Atomicity –
o This property ensures that either the transaction occurs completely or it does not
occur at all.
o In other words, it ensures that no transaction occurs partially.
Consistency –
o This property ensures that integrity constraints are maintained.
o In other words, it ensures that the database remains consistent before and after the transaction.
Isolation –
o This property ensures that multiple transactions can occur simultaneously
without causing any inconsistency.
o The resultant state of the system after executing all the transactions is the same as the state that would be achieved if the transactions were executed serially one after the other.
Durability –
o This property ensures that all the changes made by a transaction after its successful execution are written successfully to the disk.
o It also ensures that these changes exist permanently and are never lost even if there occurs a failure of any kind.
Schedules:
The order in which the operations of multiple transactions appear for execution is called as a schedule.
Serial Schedules –
o All the transactions execute serially one after the other.
o When one transaction executes, no other transaction is allowed to execute.
o Serial schedules are always- Consistent, Recoverable, Cascadeless and Strict. ●
Non-Serial Schedules –
o Multiple transactions execute concurrently.
o Operations of all the transactions are inter leaved or mixed with each other.
o Non-serial schedules are not always- Consistent, Recoverable, Cascadeless and
Strict.
Serializability –
● Some non-serial schedules may lead to inconsistency of the database.
● Serializability is a concept that helps to identify which non-serial schedules are correct and will maintain the consistency of the database.
Serializable Schedules –
o If a given non-serial schedule of ‘n’ transactions is equivalent to some serial
schedule of ‘n’ transactions, then it is called as a serializable schedule.
o Serializable schedules are always- Consistent, Recoverable, Cascadeless and
Strict.
Types of Serializability –
● Conflict Serializability – If a given non-serial schedule can be converted into a serial schedule by swapping its non-conflicting operations, then it is called a conflict serializable schedule.
● View Serializability – If a given schedule is found to be viewed as equivalent to some serial schedule, then it is called a view serializable schedule.
Non-Serializable Schedules –
● A non-serial schedule which is not serializable is called a non-serializable schedule.
● A non-serializable schedule is not guaranteed to produce the same effect as produced by some serial schedule on any consistent database.
● Non-serializable schedules- may or may not be consistent, may or may not be
recoverable.
● Irrecoverable Schedules – If in a schedule,
o A transaction performs a dirty read operation from an uncommitted transaction
o And commits before the transaction from which it has read the value then such a
schedule is known as an Irrecoverable Schedule.
● Recoverable Schedules –If in a schedule,
o A transaction performs a dirty read operation from an uncommitted transaction
o And its commit operation is delayed till the uncommitted transaction either
commits or roll backs
then such a schedule is known as a Recoverable Schedule.
Types of Recoverable Schedules –
● Cascading Schedule – If in a schedule, failure of one transaction causes several other dependent transactions to rollback or abort, then such a schedule is called as a Cascading Schedule or Cascading Rollback or Cascading Abort.
● Cascadeless Schedule – If in a schedule, a transaction is not allowed to read a data item until the last transaction that has written it is committed or aborted, then such a schedule is called as a Cascadeless Schedule.
● Strict Schedule – If in a schedule, a transaction is neither allowed to read nor write a data item until the last transaction that has written it is committed or aborted, then such a schedule is called as a Strict Schedule.



File Structures:
● Primary Index: A primary index is an ordered file, records of fixed length with two fields. First field is the same as the primary key as a data file and the second field is a pointer to the data block, where the key is available. The average number of block accesses using index = log2Bi + 1, where Bi = number of index blocks.
● Clustering Index: Clustering index is created on data file whose records are physically ordered on a non-key field (called Clustering field).
● Secondary Index: Secondary index provides secondary means of accessing a file for which primary access already exists.
B Trees:
At every level , we have Key and Data Pointer and data pointer points to either block or record.
Properties of B-Trees:
Root of B-tree can have children between 2 and P, where P is Order of tree.
Order of tree – Maximum number of children a node can have.
Internal node can have children between ⌈ P/2 ⌉ and P
Internal node can have keys between ⌈ P/2 ⌉ – 1 and P-1
B+ Trees
In B+ trees, the structure of leaf and non-leaf are different, so their order is. Order of non-leaf will be higher as compared to leaf nodes. Searching time will be less in B+ trees, since it doesn’t have record pointers in non-leaf because of which depth will decrease.
Hi! I know this is somewhat off topic but I was wondering which blog platform are you using for this site? I’m getting tired of WordPress because I’ve had issues with hackers and I’m looking at options for another platform. I would be great if you could point me in the direction of a good platform.
Very nice style and good subject matter, absolutely nothing else we need : D.
Howdy! I just would like to give an enormous thumbs up for the good data you’ve right here on this post. I will likely be coming again to your weblog for extra soon.
When I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove me from that service? Thanks!
I believe you have mentioned some very interesting details , regards for the post.
Usually I don’t read article on blogs, however I would like to say that this write-up very compelled me to try and do so! Your writing style has been amazed me. Thanks, quite nice article.
Wonderful web site. Lots of useful information here. I¦m sending it to a few pals ans additionally sharing in delicious. And of course, thanks on your sweat!
Yeah bookmaking this wasn’t a risky conclusion great post! .
But wanna admit that this is very useful, Thanks for taking your time to write this.
Hi, Neat post. There is a problem together with your website in internet explorer, would check this?K IE still is the marketplace leader and a big component to other people will leave out your fantastic writing due to this problem.
I genuinely enjoy looking at on this site, it holds great content. “A short saying oft contains much wisdom.” by Sophocles.
Great amazing issues here. I?¦m very satisfied to peer your post. Thank you so much and i’m taking a look forward to touch you. Will you please drop me a e-mail?
Hi, I think your site might be having browser compatibility issues. When I look at your website in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, fantastic blog!
It¦s really a great and helpful piece of information. I am glad that you shared this useful info with us. Please keep us informed like this. Thanks for sharing.
Thanks for your personal marvelous posting! I really enjoyed reading it, you will be a great author.I will be sure to bookmark your blog and will come back down the road. I want to encourage continue your great posts, have a nice holiday weekend!
real cialis buy tadalafil 20mg generic gnc ed pills
I do agree with all the ideas you have presented in your post. They are very convincing and will definitely work. Still, the posts are very short for newbies. Could you please extend them a bit from next time? Thanks for the post.
Hello I am so delighted I found your blog page, I really found you by accident, while I was searching on Google for something else, Anyhow I am here now and would just like to say cheers for a marvelous post and a all round enjoyable blog (I also love the theme/design), I don’t have time to read it all at the minute but I have book-marked it and also added your RSS feeds, so when I have time I will be back to read more, Please do keep up the superb job.
buy cefadroxil medication duricef 250mg pills order proscar 1mg without prescription
purchase diflucan sale buy acillin without prescription order cipro for sale
estrace 1mg us prazosin online prazosin 2mg cheap
flagyl us order cephalexin 125mg generic cephalexin 125mg usa
brand vermox 100mg buy mebendazole generic cheap tadalis 20mg
buy cleocin pills for sale buy cleocin 300mg pills buy ed pills for sale
purchase avanafil pill generic diclofenac 100mg diclofenac 100mg generic
order indomethacin 75mg without prescription lamisil online order buy suprax 200mg sale
bimatoprost drug order desyrel 100mg online buy generic trazodone
order trimox 250mg generic buy arimidex 1mg without prescription order biaxin 250mg without prescription
order sildenafil suhagra order sildenafil 150mg
buy generic minocin buy terazosin 1mg pills order actos 30mg generic
isotretinoin 20mg over the counter isotretinoin 10mg brand azithromycin 250mg oral
cheap tadalafil 5mg cialis tadalafil 20mg generic tadalafil 5mg
azithromycin over the counter order prednisolone online buy cheap generic gabapentin
ivermectin covid natural ed pills order deltasone 10mg generic
order furosemide without prescription buy generic doxycycline online ventolin 4mg for sale
brand levitra 10mg order plaquenil 200mg hydroxychloroquine 200mg brand
order vardenafil 10mg for sale cost plaquenil order hydroxychloroquine online