0% found this document useful (0 votes)
6 views6 pages

Database Concept

The document provides an overview of database concepts, including definitions of databases and Database Management Systems (DBMS), their functions, and components like tables, queries, and relationships. It discusses various database models such as flat files, hierarchical, network, relational, object-oriented, and object-relational databases, along with normalization processes and SQL usage for data management. Additionally, it emphasizes the importance of metadata in describing and organizing data effectively.

Uploaded by

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

Database Concept

The document provides an overview of database concepts, including definitions of databases and Database Management Systems (DBMS), their functions, and components like tables, queries, and relationships. It discusses various database models such as flat files, hierarchical, network, relational, object-oriented, and object-relational databases, along with normalization processes and SQL usage for data management. Additionally, it emphasizes the importance of metadata in describing and organizing data effectively.

Uploaded by

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

Lecture Notes on Database Concepts

Database and Database Management System (DBMS)

• Database: A database is a collection of organized data that can be easily accessed,


managed, and updated. It can store information in various formats such as
numbers, text, images, or even video. Databases are designed to handle large
amounts of data in a structured way, ensuring efficient retrieval and management.

✓ Example: A library database stores information about books (titles,


authors, genres), patrons (names, addresses), and transactions (borrowed
books, dates).

• Database Management System (DBMS): A DBMS is software that manages


databases, providing an interface for users to create, update, manage, and query
databases. It ensures data integrity, security, and efficient management.

✓ Functions of a DBMS:

▪ Data Storage and Retrieval: Storing data efficiently and retrieving


it as needed.

▪ Data Manipulation: Allowing users to insert, update, delete, and


query data.

▪ Security and Integrity: Ensuring only authorized access to data


and maintaining data accuracy.

▪ Concurrency Control: Allowing multiple users to interact with the


database simultaneously without conflict.

Example:

• MySQL, Oracle, and Microsoft SQL Server are popular DBMSs.

Database Components

A database consists of various components that work together to store and manage data
efficiently:

• Tables: A table is a collection of rows (records) and columns (attributes). Each


row represents an entity, and each column represents an attribute of that entity.
✓ Example: A "Students" table with columns like "Student ID", "Name", "Date
of Birth", and "Major".

• Queries: Queries are requests to retrieve or manipulate data in the database. SQL
(Structured Query Language) is the standard query language used to interact with
relational databases.

• Forms: Forms provide a user interface for entering, updating, and interacting with
data in a database.

• Reports: Reports provide a formatted output of data, often for analysis or


presentation.

• Indexes: Indexes are used to speed up the retrieval of data by creating pointers to
specific rows based on certain column values.

• Relationships: These define how tables are related to each other. In a relational
database, relationships are typically defined using primary and foreign keys.

Example:

• A "Books" table in a library database might have columns for "Book ID", "Title",
"Author", and "Genre", and it would be linked to a "Transactions" table using a
"Book ID" as a foreign key.

Types of Database Models

Database models define the structure and organization of data within a database. The
main types of database models include:

4.3.1 Flat Files, Hierarchical Database, Network Database

• Flat Files: In a flat file database, data is stored in a simple two-dimensional


structure, like a spreadsheet or text file. There is no inherent relationship between
data elements.

✓ Example: A CSV file containing employee data with columns like


"Employee ID", "Name", and "Position". Each row is a record, and there is
no formal relationship between rows.
• Hierarchical Database: In a hierarchical database, data is organized into a tree-
like structure where each record has a single parent, and records are linked in a
parent-child relationship.

✓ Example: An organizational chart where a company (root) has


departments (branches), and departments have employees (leaves).

• Network Database: Similar to hierarchical models, but records can have multiple
parents, creating a more complex, graph-like structure of interconnected records.

✓ Example: A network database for a university where students are linked to


courses and professors. A course could have many students and many
professors, and each student could enroll in multiple courses.

4.3.2 Relational Database

• Relational Database: A relational database stores data in tables (relations) that


are connected via relationships (keys). It uses a set of operations, like SELECT,
INSERT, UPDATE, and DELETE, to manage and query data.

✓ Key Concepts:

▪ Primary Key: A unique identifier for each record in a table (e.g.,


"Student ID").

▪ Foreign Key: A reference to the primary key of another table,


establishing a relationship between tables (e.g., a "Department ID"
in the "Students" table referencing the "Departments" table).

✓ Example: A "Customers" table with customer details and an "Orders" table


that references the "Customer ID" from the "Customers" table.

Object-Oriented and Object-Relational Database

• Object-Oriented Database: An object-oriented database stores data in the form


of objects, as used in object-oriented programming. Data and methods (functions)
are encapsulated in objects, and relationships between objects are modeled.
✓ Example: A database for a video game might store data as objects
representing characters, items, and levels, where each object has attributes
(e.g., name, health) and methods (e.g., attack, heal).

• Object-Relational Database: An object-relational database is a hybrid of


relational and object-oriented databases. It allows the use of complex data types
and methods while still supporting the traditional relational model.

✓ Example: PostgreSQL is an example of an object-relational DBMS, where


you can store more complex data types like arrays and ranges.

4.4 Normalization: Relational Database

Normalization is the process of organizing data in a database to reduce redundancy and


dependency. The goal is to break data into multiple tables and define relationships
between them to ensure data integrity.

• Normal Forms: The process of normalization is carried out in stages, each known
as a "normal form" (1NF, 2NF, 3NF, etc.). The most common are:

1. 1st Normal Form (1NF): Ensures that each table has a primary key, and all
columns contain atomic (indivisible) values.

2. 2nd Normal Form (2NF): Removes partial dependencies, ensuring that all
non-key columns depend on the entire primary key.

3. 3rd Normal Form (3NF): Removes transitive dependencies, ensuring that


non-key columns depend only on the primary key.

Example:

• A "Student-Course" table that has multiple courses for each student might be in
1NF, but after normalization, we would separate it into a "Students" table and a
"Courses" table to eliminate redundancy.

4.5 Standard Query Language (SQL)

SQL (Structured Query Language) is the standard language for managing and querying
relational databases. SQL allows users to define, manipulate, and query data within a
database.
• Common SQL Commands:

✓ SELECT: Retrieves data from one or more tables.

▪ Example: SELECT * FROM Students WHERE Age > 18;

✓ INSERT: Adds new records into a table.

▪ Example: INSERT INTO Students (ID, Name, Age) VALUES (1, 'John
Doe', 20);

✓ UPDATE: Modifies existing records.

▪ Example: UPDATE Students SET Age = 21 WHERE ID = 1;

✓ DELETE: Removes records from a table.

▪ Example: DELETE FROM Students WHERE ID = 1;

✓ CREATE: Defines new tables, views, or indexes.

▪ Example: CREATE TABLE Students (ID INT, Name VARCHAR(100),


Age INT);

Metadata – Data About Data

Metadata is data that describes other data. It provides context, meaning, and structure
to the data, making it easier to understand, manage, and use effectively. Metadata can
describe the content, quality, format, and relationships of the data.

• Types of Metadata:

1. Descriptive Metadata: Provides information about the data, like its title,
author, and keywords.

▪ Example: A file might have metadata describing the author of a


report and the creation date.

2. Structural Metadata: Describes the organization and relationships


between data elements.

▪ Example: A relational database table may have metadata defining


relationships between tables (e.g., foreign keys).
3. Administrative Metadata: Provides information on the data's creation,
storage, and access rights.

▪ Example: Metadata might describe the format of the data, such as


whether it is in CSV or JSON format, and its access permissions.

Example:

• A photograph file might have metadata that includes the date the photo was taken,
the camera model, and the GPS coordinates of where it was taken.

Summary

➢ Understanding database concepts is crucial for effectively managing, storing, and


retrieving data.
➢ This includes knowing about different database models, normalization
techniques, and using SQL for querying and manipulating data.
➢ Additionally, managing metadata ensures that data is properly described,
organized, and accessible for further use.

You might also like