Assignment
Assignment
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
DATAMODELLING(10)
Data Modelling
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.
• 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:
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.
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.
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