DATABASE CONCEPT
DATABASE CONCEPT
• Advantages:
• Cost-effective: No need to buy computers or software.
• No data loss: If you lose power, your records are still safe on paper.
• Disadvantages:
• Hard to share: If someone wants to see the records, they have to physically look at
the notebook.
• Time-consuming: Correcting mistakes means crossing things out and rewriting.
• Advantages:
• Easy to access: You can quickly look up information using a search function.
• Backup options: You can save your data in multiple places to prevent loss.
• Disadvantages:
• Costly: You need to buy computers and software.
• Requires training: Staff need to learn how to use the software.
Examples of DBMS
• MySQL: Often used for web applications.
• Oracle: Commonly used by large businesses for complex data needs.
• Microsoft Access: A user-friendly option for small businesses or individual projects.
Applications
DBMS is used in various fields like schools for student records, hospitals for patient
information, and businesses for managing sales data.
Tuple
• What is it?: A tuple represents a single record in a table (like a row).
• Example: For the student database, one tuple might be (1, "Alice", 15, "10th
Grade").
Domain
• What is it?: The set of valid values that an attribute can have.
• Example: The domain for Age might be any number from 5 to 18.
Data Constraints
These are rules that ensure data integrity. They prevent incorrect data from being
entered into the database.
• Example: A constraint might prevent entering an age less than 5 or greater than 18.
Meta-data/Data Dictionary
This contains information about the database structure, such as what tables exist and
what attributes they have.
Database Operations
Query
A query is a request for information from the database. You can think of it as asking
the database a question.
Primary Key
A primary key is the main attribute used to identify records uniquely.
• Example: Roll_no could be chosen as the primary key because it’s unique for every
student.
Foreign Key
A foreign key is an attribute that links one table to another by referencing a primary
key from another table.
• Example: If you have a class table where each class has many students, you might
have Class_id as a foreign key in the student table linking back to the class table.