0% found this document useful (0 votes)
19 views

Short Answer Questions: 1. Define The Term Cardinality?

Sql database

Uploaded by

ayub6u7
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 views

Short Answer Questions: 1. Define The Term Cardinality?

Sql database

Uploaded by

ayub6u7
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/ 7

SHORT ANSWER QUESTIONS:

1. Define the term cardinality?


In a database context, cardinality refers to the number of unique
values in a relational table column relative to the total number of
rows in the table.
OR
In DBMS (Database Management System), the term cardinality
refers to the uniqueness or the number of elements in a set or a
relationship between entities in a database.

2. Write down the different between composite attribute and


multivalued attribute?
A composite attribute is an attribute that can be subdivided into
smaller, independent attributes that hold meaningful information.
It is composed of multiple sub-attributes that together form a
single attribute.
A multivalued attribute is an attribute that can have multiple
values for a single entity or record.
It can hold a set of values rather than a single value.

3. What is Metadata?
Metadata refers to "data about data." It provides information or
context about other data, helping users understand and work with
that data more effectively. Metadata describes the characteristics,
structure, and meaning of data, making it easier to search, manage,
and use in various applications.

4. What is data Independence?


Data independence is the ability to make changes in either the
logical or physical structure of the database without requiring
reprogramming of application programs. It allows for flexibility
and efficiency in database design.
5. Write down the difference between Database and DBMS?
A database is a collection of organized data that is stored and
managed in a structured manner. It can include tables, records,
fields, and other data elements. The data itself is stored in a
database.
A DBMS is software that provides an interface to interact with the
database. It allows users and applications to create, retrieve,
update, and manage the data in the database efficiently.

6. Define the term Atomicity?


Atomicity is a property of database transactions that ensures that a
set of database operations either all occur, or none occur.

7. List down properties of a relation/table?


Rows (Tuples) Columns (Attributes) Unique Rows
Domain Constraints Primary Key Foreign Key
Integrity Constraints Atomic Values
Each Column Has a Unique Name
Long Answer Questions:
Question#2

1.Student Table
student_id Student_name
1 Alice
2 Bob
3 Charli
4 Diana
5 Alex
6 James

2.Course Table
course_id course_name cr_hours
1 Database Systems 3
2 Data Structures 3
3 Web Development 4
4 Operating Systems 3

3.Enrolled Table
student_id course_id course grade
1 1 Database Systems A
1 2 Data Structures B
2 1 Database Systems C
3 3 Web Development A
4 1 Database Systems B
5 2 Data Structures A
6 4 Operating Systems C
SQL Queries with Examples:
1) Query to show which students are enrolled in the Database
course:
SELECT s.student_id, s.student_name
FROM Student s
JOIN Enrolled e ON s.student_id = e.student_id
JOIN Course c ON e.course_id = c.course_id
WHERE c.course_name LIKE '%Database%';
Result:
student_id student_name
1 Alice
2 Bob
4 Diana

2) Query to display students whose names start with 'A' and end
with 'S':
SELECT student_id, student_name
FROM Student
WHERE student_name LIKE 'A%S';
Result:
student_id student_name
5 Alex

3) Query to count the number of students from the Student table:


SELECT COUNT(*) AS number_of_students
FROM Student;
Result:
number_of_students
6
4) Query to insert a record into the Course table:
INSERT INTO Course (course_id, course_name, cr_hours)
VALUES (5, 'Artificial Intelligence', 4);
Result:
course_id course_name cr_hours
1 Database Systems 3
2 Data Structures 3
3 Web Development 4
4 Operating Systems 3
5 Artificial Intelligence 4

Question#1
Write down a detail note on Three Tier Architecture?
Three-Tier Architecture
Three-Tier Architecture is a software design pattern that separates
applications into three distinct layers or tiers: the presentation tier,
the application tier (also known as the business logic tier), and the
data tier. This architectural model promotes the separation of
concerns, making it easier to develop, maintain, and scale
applications. Here’s a detailed overview of each tier, its
components, and its benefits.

Overview of the Three Tiers


Presentation Tier (Client Tier)
This is the topmost layer of the
architecture, which is responsible for displaying data to the user and
handling user interaction. It acts as the interface between the user
and the application.
Components: Web browsers, mobile applications, desktop
applications, or any user interface that interacts with the user.
Responsibilities
-Display information to the user in a user-friendly format.
- Capture user inputs and send them to the application tier for

Application Tier (Business Logic Tier)


This middle layer is responsible for processing the data received
from the presentation tier, applying business rules, and interacting
with the data tier. It acts as a bridge between the presentation and
data tiers.
Components: Application servers, web servers, middleware, and
business logic components (e.g., APIs, services).
Responsibilities
- Execute business logic and processes.
- Perform data validation and transformations.
- Coordinate communication between the presentation tier and
data tier.
- Handle application security, authentication, and authorization.

Data Tier:
This bottom layer is responsible for data storage,
retrieval, and management. It consists of databases and data
management systems.
Components: Database servers (e.g., MySQL, PostgreSQL, Oracle,
MongoDB) and data storage systems.
Responsibilities
- Store and manage application data.
- Ensure data integrity and security.
- Provide mechanisms for data access and retrieval (e.g., SQL
queries, data APIs).
- Perform backup and recovery operations.
Communication Between Tiers
Client-Server Interaction: The presentation tier communicates
with the application tier using APIs or web services (e.g., RESTful APIs
or SOAP). The application tier processes the requests, interacts with the
data tier, and returns the results to the presentation tier.
Data Access: The application tier communicates with the data tier
using database queries or ORM (Object-Relational Mapping)
frameworks, allowing it to perform CRUD (Create, Read, Update,
Delete) operations on the data.

the drawbacks, making it a popular choice for modern software


development.

You might also like