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

Assignment

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Assignment

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

DEPARTMENT:COMPUTER ENGINEERING

MODULE:DATABASE SYSTEMS
MODULE CODE:HSE\HCE\HHE114
GROUP10
GROUP MEMBERS
DENZEL CHIMOTO R236577S HCE
TAWANDA GONYORA R231699F HSE
KUDAKWASHE MASHONGANYIKA R23I681A HSE
JOSEPH CHIGOVA R231682T HSE
TAKUNDANASHE MUTENJE R231350J HCE
GRACIANS NYARIRI R223717Y HHE
PART1
1 DEFINE A DATABASE SYSTEM AND EXPLAIN ITS PURPOSE
A database system is a collection of programs or software that is used to store, manipulate and
retrieve information which is stored in form of tables electronically ,information can be
searched, sorted and updated depending on the user requirements. For example a school can
have a database where it stores student information,staff information such as
address,firstname,registration details this information can be updated,sortby name even
searched when the information is needed
The purpose of a database system are it serves as a powerhouse for managing ,organizing ,
securing data enabling efficient operations and informed decision making

2. Describe the architecture of a database system


The structure of a database architecture encompases the structural design and methodology of
a database.It described how data is stored ,managed and accessed.The architecture of a
database architecture is as follows: Centralized databases: in centralized databases the
information is stored in a single location where it managed using single entity.Decentralized
databases:These type of architecture distribute data across multiple locations for example in
blockchain system databases

3.Explain the concept of transaction management and its importance


Transaction is a set of operation that are used to perform logical operations such as
update,delete,insert that are grouped as a single unit.Transaction management is an integral
process of database management system which involves overseeing ,coordination and
execution of any given attempted transaction its importance are it ensures data integrity and
consistency,preventing interference between concurrent transaction and helps to optimize
database performance.Transaction management also helps in data recovery for instance in case
of system failure transaction management ensures that the database can be restored to a
consistent state

4.List advantages and disadvantages of a database system.


The advantage of database system are database systems ensures fast retrival of information
needed by users this increase performance in software systems that are connected to that data
base.database systems ensures security by providing acces control at different levels for
example user, administrator each of these users have access control to information at different
levels this increase security to a system
How ever database systems address various requirements which make them complex to design
and manage which means that users and administrators must have database skills otherwise
this can lead to loss of vital information

DATAMODELLING(10)

Data Modelling

1.Data modelling is:

Data modelling is a process used to visualize and understand the structure of information and its
deployment involving three stages, or types of data model conceptual, logical, and physical.

Why is it important:

• Data modelling helps in the visual representation of data and enforces business rules, regulatory
compliances, and government policies on the data.

• Data Models ensure consistency in naming conventions, default values, semantics, security while
ensuring quality of the data.

2.The Unified Modelling Language (UML) and its relevance to data modelling:
• It is an industry-standard graphical language for specifying, visualizing, constructing, and documenting
the artifacts of software systems and it uses mostly graphical notations to express the 0O analysis and
design of software projects. It Simplifies the complex processes of information system analysis and
design.

3.Explain different types of data models

Relational Data Model:


• This type of model designs the data in the form of rows and columns within a table. Thus, a
relational model uses tables for representing data and in-between relationships.

Entity-Relationship Data Model:


• An ER model is the logical representation of data as objects and relationships among them.
These objects are known as entities, and relationship is an association among these entities.

Object-based Data Model:


• An extension of the ER model with notions of functions, encapsulation, and object identity, as
well. This model supports a rich type system that includes structured and collection types.

Semi structured Data Model:


• This type of data model is different from the other three data models ( above). The semi
structured data model allows the data specifications at places where the individual data items
of the same type may have different attributes sets.
4.Discuss the importance of data modelling in database design

• A comprehensive and optimized data model helps create a simplified, logical database that
eliminates redundancy, reduces storage requirements, and enables efficient retrieval. It also
equips all systems with a ‘single source of truth’ which is essential for effective operations and
provable compliance with regulations and regulatory requirements. Data modelling is a key
step in two vital functions of a digital enterprise.
Structured Query Language(SQL)
1.The SQL Queries for the given data:

Question5
SELECT Employees.name FROM Employees INNER JOIN Departments ON
Employees.DepartmentID=Departments.DepartmentID WHERE Departments.DepartmentName
= ‘RESEARCH’;

Question6
SELECT Projects.ProjectName,SUM(Assignments.HoursWorked) FROM Employees INNER JOIN
Projects ON Employees.DepartmentID = Projects.DepartmentID;

Question7
SELECT Departments.DepartmentName, AVG(Employees.Salary) FROM Employees INNER JOIN
Departments ON Employees.DepartmentID = Departments.DepartmentID GROUP BY
Departments.DepName;

Question8
UPDATE Employees SET Salary=60000 WHERE EmployeeID =123;

Question9
DELETE * FROM Assignments WHERE AssignmentID =456;

Question10
CREATE VIEW [Summary] AS SELECT Projects.ProjectName, Employees.name,
Assignments.HoursWorked FROM Assignments INNER JOIN Projects ON
Assignments.ProjectID=Projects.ProjectID INNER JOIN Employees ON Assignments.EmployeeID
= Employees.EmployeeID;
2.Integrity Constraints
Answer:
Integrity Constraints are set of values used to maintain the quality of information. They ensure
that the data insertion, updating and ither processes must be performed in such a way that
data integrity is not affected.

Examples:
Domain Constraints:

 These are the definitions of a valid set of values for an attribute.


 The data type of domain includes string, character, integer, time, date, currency, etc.
 The value of the attribute must be available in the respective domain.

ID NAME SEMESTEWR AGE


1000 JOSEPH 1st 17
1001 KUDAKWASHE 2nd 24
1002 TAKUNDA 3rd 19
1003 GRACIANS 5th 21
1004 DENZEL 8th A

Not Allowed. Because AGE is an integer attribute.

Entity Integrity Constraints:

 The entity integrity constraint states that primary key value can’t be null.
 This is because the primary key value is used to identify individual rows in relation and if
the primary key has a null value, then we can’t identify those rows.

Emp_ID Emp_name Salary


1000 JOSEPH 1600
1001 KUDAKWASHE 12412
1002 TAKUNDA 1241
1003 GRACIANS 592389
DENZEL 11421

Not Allowed as Primary Key can’t contain a NULL value

Referential Integrity Constraints:

 A referential integrity constraint applies on two tables.


 If a foreign key in Table1 refers to the Primary Key of Table2, then every value of the
Foreign Key in Table 1 must be null or be available in Table 2

Key Constraints:
 Keys are the entity set that is used to identify an entity within its entity set uniquely.
 An entity set can have multiple keys, but out od which one key will be the Primary Key.

ID NAME SEMESTEWR AGE


1000 JOSEPH 1st 17
1001 KUDAKWASHE 2nd 24
1002 TAKUNDA 3rd 19
1003 GRACIANS 5th 21
1002 DENZEL 8th 22

Not Allowed. Because all rows must be unique.


COURSENAM
E COURSE ID

COURSE/ LASTNAME

FIRSTNAME
REGNUMBER
COURSES FIRSTNA
ME

has
IDNUMBE
STUDENT R

ENROLLS LASTN
S AME

teaches ENROLLMENT

teache
s

ADDRESS

AGE

INSTRUCTORS
GENDER

COURSE ID

ID NUMBER FIRSTNAME LASTNAME

You might also like