CSC-433
CSC-433
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
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
Conceptual
ER-Model Layer-2 Database designers
Schema
Physical Internal/
Layer-3 DBA
storage/location Physical schema
DB/HD
Data independence
User User
Conceptual
ER-Model Layer-2 Database designers
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.
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?
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.