0% found this document useful (0 votes)
19 views19 pages

CSC-433

Uploaded by

21303166
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)
19 views19 pages

CSC-433

Uploaded by

21303166
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/ 19

CSC 433

Database Management System


Write down the difference's between data and information.
Data Information

1. Unorganized collection of Information. 1. Organized collection of data.


2. Data is a raw fact it can be recorded and can be 2. Information basically process data.
accessed.
3. Information is group of data that collecting logical meaning.

 Define Database.
 A database is a collection of organized data that is stored in a way that makes it easy to access, manage, and update.
• Example: A customer database would store information like names, addresses, and phone numbers in an organized
manner so that you can quickly look up a customer’s details.

 What is meta-data?
 Metadata is data about data. It gives information about what the data is, helping to describe, organize, or find it more
easily.
• Example: For a book, the metadata would include details like the title, author, publication date, and genre. This
information helps you know more about the book without reading it.
Functionalities of DBMS.
1. Define: This means creating the structure of the database. You set up what kind of data you’ll store, such as names, numbers,
or dates, and decide how it will be organized.
Example: Defining tables for customers and products in a database.
2. Construct: This is about storing the data in the database. After defining the structure, you fill it with the actual data.
Example: Adding customer names, addresses, and phone numbers to the database.
3. Manipulate: This involves interacting with the data by retrieving, updating, or deleting it as needed. You can search for specific
data, change it, or remove old information.
Example: Searching for a customer’s information or updating their phone number.
4. Share: This function allows multiple users or applications to access the database at the same time. It ensures that the right
people can access the data they need while keeping it secure.
Example: Allowing different departments in a company to view and use the same database.
 Here are the characteristics of a database :

1.Self-Describing Database: The database stores both data and information about the data (like table names
and column types), so it can explain itself.
• Example: A database knows it has a "Customers" table with columns for "Name" and "Address."
2.Data Independence: Programs can access data without needing to know how it's stored inside the database.
• Example: You can get customer info without knowing the technical details of the database structure.
3.Multiple Views: Different users can see the same data in different ways, depending on what they need.
• Example: Sales sees contact info, while Finance sees billing info, all from the same data.
4.Data Sharing & Multiuser Access: Multiple people can use the database at the same time without conflicts.
• Example: Several employees can update records simultaneously, and the database keeps it organized.
Database Users:
1. Actors on the Scene
2. Workers behind the Scene

 Actors on the Scene:


1.Database Administrators (DBAs): DBAs keep the database running smoothly, securely, and backed up.
• Example: A DBA might set up user access, monitor database speed, and restore data if there's a
failure.
2.Database Designers: Designers plan the database structure, deciding on tables and data relationships.
• Example: A designer creates a plan for tables like "Customers," "Orders," and "Products."
3.End Users: These are people who use applications to interact with the database for tasks.
• Example: A salesperson viewing customer details in a software app is an end user.
4.System Analysts and Application Programmers: Analysts find out what features a system needs, while
programmers build the applications.
• Example: An analyst plans a customer management system, and a programmer codes it.
 The "Workers behind the scenes" in a database:
1.DBAs (Database Administrators): They keep the database running, secure, and backed up.
• Example: A DBA sets up user access and fixes issues.
2.Database Designers: They plan how the data is organized and related.
• Example: A designer creates tables like "Customers" and "Orders."
3.System Analysts: They figure out what features the system needs based on company goals.
• Example: An analyst decides a customer management system should track contacts and sales.
4.Application Programmers: They build the software that interacts with the database.
• Example: A programmer codes an app for sales staff to view customer info.
 Four types of end users:
Here’s a simplified and easy-to-understand version of the four types of end users:
1. Casual End Users: These users only use the database occasionally and through easy-to-use interfaces. They don’t
need to know much about how the database works.
Example: A manager checking monthly reports.
2. Naive or Parametric End Users: These users use predefined applications to perform simple tasks, like entering data or
running basic reports, without understanding how the database works.
Example: A clerk entering customer information into a form.
3. Sophisticated End Users: These users have a good understanding of the database and can write complex queries to
get the information they need.
Example: A data analyst generating detailed reports using SQL.
4. Standalone Users: These users work independently with their own databases, often on personal computers, without
connecting to a larger system.
Example: A small business owner using software to track sales and inventory.
 Three types of data model:
Here’s a simplified version of the three types of data models:
1. Conceptual Data Models: These give a high-level view of the data and how it's related, without technical details.
Example: A diagram showing customers, orders, and products, but not how they are stored.
2. Physical Data Models: These describe how data will be physically stored in the database, including data types and
indexing.
Example: Setting up a customer table with data types for each column and indexing for fast access.
3. Implementation Data Models: These focus on how the database will be built in a specific DBMS, using the actual
database commands.
Example: The SQL statements used to create tables and relationships in a MySQL database.

 What is database schema?


 In a data model, it's important to understand the difference between the actual data in a database and the
plan or structure of the database. The description of a database—how it’s organized and structured—is called
the database schema.
1. Schema Diagram: A schema diagram is a simple drawing that shows how a database is organized, including tables
and their connections.
2. Schema Construct: A schema construct is any part of a database's structure, like a table or a column, that defines
how the data is arranged.

What is Instance?
 An instance is the current data in a database at a specific time.
•Example: If a "Students" table has 50 records today, that is the current instance.
Three Schema Architecture

User User

External view --------------- External view Front end designers


User interface Layer-1

Conceptual
ER-Model Layer-2 Database designers
Schema

Physical Internal/
Layer-3 DBA
storage/location Physical schema

DB/HD
Data independence

User User

External view --------------- External view Front end designers


User interface Layer-1

Logical data independence

Conceptual
ER-Model Layer-2 Database designers
Schema

Physical data independence


Physical Internal/
Layer-3 DBA
storage/location Physical schema

DB/HD
 Explain three schema architecture with the concept of data independence.
The Three-Schema Architecture consists of three layers:
1.External View (Layer-1): This layer is what the users see and interact with. It provides different views of the data for
different users, depending on their needs.
2.Conceptual Schema (Layer-2): This layer represents the overall logical structure of the entire database. It defines how
data is organized without concern for how it is physically stored.
3.Internal/Physical Schema (Layer-3): This layer is concerned with how the data is physically stored in the database,
including storage mechanisms and access paths.

Data Independence:
•Logical Data Independence: Changes in the conceptual schema do not affect the external schema. Users can still access
their data without changing their applications, even if the database structure changes.
•Physical Data Independence: Changes in the internal schema do not affect the conceptual schema. The way data is stored
can change without impacting how it’s organized or accessed by users.

Draw Diagram (Data Independence)


2 – tire Architecture

ODBC driver
Application program Database

Client Server
Software

 2-Tier Architecture is a simple database architecture with two main layers: the client and the server.
1. Client (User Interface): This is what the user sees and interacts with. It’s the “front end” that shows up on your
screen. The client asks the server for things, like getting or updating data. It could be a web browser or a software
application.
2. Server (Database): This is where the data is stored and managed, known as the “back end.” The server responds to
the client’s requests by retrieving or saving data and then sending it back to the client.

[In a 2-tier architecture, the client directly communicates with the server, and both layers are closely connected. The
client handles the user interface, while the server handles data management.]
 3 – tire Architecture:

1. Client (User Interface): This is what users see and use to interact with the system. It sends user requests to the next
part but doesn’t touch the database.
2. Application (Processing): This part handles the requests from the user, applies rules, and talks to the database. It
connects the user and the data.
3. Database (Storage): This is where all the data is kept. It responds to the application’s requests, giving or updating
data as needed, then sends it back to the user.
 Explain why we have move 2-tier architecture to 3-tier architecture?

Here’s why we moved from 2-tier to 3-tier architecture, explained simply:


1. In 3-tier, the middle layer (application layer) handles many client requests more efficiently, so it’s easier to
add more users as the system grows.
2. With 3 layers, there’s an extra layer (application layer) between the client and the database. This adds
security by controlling access to the data.
3. Each layer—user interface, logic, and data—is separate, so you can update one without affecting the
others, making changes simpler and less risky.
4. The application layer does the complex work, so the client and database don’t get overloaded. This keeps
things running smoothly, especially in large systems.
5. The application layer’s logic can be reused across different platforms (like web browsers and mobile apps),
so the system is more versatile.
 Here are 7- types of database interfaces:
Interface is a program that allows users to query without writing a code in query language.

1.Form-Based Interface: Users fill out fields in a form to complete a task: No technical knowledge is needed:
Example: Signing up for a service by entering your name, address, and phone number.
2.Menu-Based Interface: Users choose from a list of options to perform a task: This makes it simple to follow:
Example: An ATM screen where you select options like "Withdraw," "Deposit," or "Check Balance."
3.Graphical User Interface (GUI): Users click on visual elements like buttons and icons to interact with the system: It’s easy
to learn:
Example: The Windows desktop, where you click on icons to open applications.
4.Natural Language Interface: Users type or speak in normal language, and the system understands and responds:
Example: Chatting with a virtual assistant (chatbot) to get your recent bank transactions.
5.Speech Input and Output Interface: Users talk to the system using voice commands, and it talks back or performs the
action:
Example: Asking Alexa or Siri to set a timer or search the internet.
6. Interface for Naive Users: Simple design for users with little technical knowledge, limiting options to avoid mistakes:
Example: A self-checkout machine, where you follow on-screen prompts to scan and pay.
7. Interface for DBA (Database Administrator): Specialized interface for database experts to manage and monitor
databases:
Example: SQL Server Management Studio (SSMS), where DBAs write queries and manage database security.
Each interface has a specific purpose, making it easier for users with different levels of experience.
 Keys in a Database Management System (DBMS):
1.Super Key: A super key is any set of columns that can uniquely identify a record in a table. It can include extra columns.
Example: In a "Products" table, "Product_ID" is a super key because it uniquely identifies each product. Adding
"Product_Name" to it also makes a super key, but "Product_ID" alone is enough.
2.Candidate Key: A candidate key is a column (or combination of columns) that can uniquely identify a record. There can be
several candidate keys, but only one will be chosen as the primary key.
Example: In an "Employees" table, both "Employee_ID" and "Email" can be candidate keys since each one can uniquely
identify an employee.
3.Primary Key: The primary key is the main candidate key chosen to uniquely identify each record in a table. It must be unique
and cannot be empty (null).
Example: In a "Students" table, "Student_ID" is the primary key because it is unique for each student.
4.Alternate Key: An alternate key is a candidate key that is not selected as the primary key. It can still uniquely identify
records.
Example: If "Employee_ID" is the primary key in an "Employees" table, then "Email" can be an alternate key since it is also
unique.
5. Unique Key: A unique key ensures that all values in a column are different from each other. It can allow one empty
(null) value.
Example: In a "Users" table, the "Username" column can be a unique key to make sure no two users have the same
username.6. Foreign Key: A foreign key is a column in one table that refers to the primary key in another table. It helps
create a relationship between the two tables.
Example: In a "Courses" table, "Instructor_ID" can be a foreign key that links to the "Instructors" table, where
"Instructor_ID" is the primary key.

You might also like