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

Tutorial 1

The document outlines a series of exercises for a tutorial on Object-Oriented Database (OODB) concepts, including the creation of UML class diagrams for various scenarios such as file directories, bank accounts, and library management. It also includes exercises on state transition diagrams for an automatic gearbox and the definition of an ODL schema for a company with departments and employees. Additionally, it requires OQL queries to analyze employee and project data within the defined schema.

Uploaded by

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

Tutorial 1

The document outlines a series of exercises for a tutorial on Object-Oriented Database (OODB) concepts, including the creation of UML class diagrams for various scenarios such as file directories, bank accounts, and library management. It also includes exercises on state transition diagrams for an automatic gearbox and the definition of an ODL schema for a company with departments and employees. Additionally, it requires OQL queries to analyze employee and project data within the defined schema.

Uploaded by

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

USTHB​ ​ ​ ​ ​ ​ ​ ​ 3rd Year of Computer Engineering

Computer Science Faculty​ ​ ​ ​ ​ ​ ​ Module: BDA


2024/2025
Tutorial 1: OODB

Exercise 1:
Propose the class diagram using UML notation, corresponding to each of the following questions,
justifying the type of relationships (cardinality, roles and constraints if necessary) between the
different classes of the proposed diagram:
1.​ A directory contains a set of files of different types: text, image, video. A file can also be a
structured file containing a set of records. A directory can be composed of subdirectories
(which are themselves directories).
2.​ A bank account can belong to a natural or legal person. A person can have multiple
accounts of different types (Savings, Current).
3.​ A modem is an input/output device. A keyboard, a mouse are input devices; a printer or a
monitor are output devices. Other devices can be identified.
4.​ A polygon is composed of several ordered points
5.​ An IT project is carried out by a team of developers (made up of several people), using one
or more programming languages ​and possibly a set of frameworks.
6.​ A gallery exhibits works, made by creators, and representing themes. A work has a single
theme. Customers, welcomed by the gallery, buy works at fluctuating prices, depending on
the date of purchase.
Exercise 2:
We want to automate the management of a library. To achieve this, we have analyzed its operation
and obtained the following list of rules:

●​ The library consists of a collection of documents and a group of members.


●​ A member is described by an ID number, last name, and first name. If the member is a
student, additional information includes their field of study, specialization, and year of
study. If the member is a professor, additional information includes their affiliated structure
(faculty/department).
●​ Members can be registered or unregistered upon request, and the request will be archived.
●​ A document is characterized by a reference number, title, index (of subjects it covers),
publisher, and storage code.
●​ Documents are either books or periodicals.
●​ A book consists of an introduction, several chapters, and a conclusion, and it can be
structured into multiple volumes.
●​ A book is written by one or more authors.
●​ Periodicals have a periodicity and a theme.
●​ Members can borrow books (only books), and it must be possible to track which books a
member has borrowed at any given time.
●​ A member can borrow a maximum of three books.
●​ The return date of a borrowed book is set at the time of borrowing. This date can be
extended upon request.
USTHB​ ​ ​ ​ ​ ​ ​ ​ 3rd Year of Computer Engineering
Computer Science Faculty​ ​ ​ ​ ​ ​ ​ Module: BDA
2024/2025
Question: Propose a class diagram for this case study.

Exercise 3:
A research laboratory hosts different members, who can be permanent researchers, associate
researchers, or PhD students. A researcher belongs to one and only one category. A person can be
a member of at most two laboratories.

The laboratory has a director who must be a member of the laboratory and can direct only one
laboratory.

Every member is described by a last name and first name.

●​ A permanent researcher is described by a rank and a function.


●​ An associate researcher is characterized by the name of their home institution.
●​ A PhD student is characterized by the date of their PhD enrollment.

A semi-annual remuneration is granted to each member and is calculated based on the member's
category and the percentage of work completed in the project.

The laboratory offers several material resources, categorized into two types: laptops and storage
devices.

●​ A resource has a state ("good," "average," "poor") and a unique number assigned at
creation (which cannot be modified). It can be assigned to a laboratory member (and the
assignment must be tracked).
●​ Laptops have an operating system, an antivirus license, and an annual maintenance cost, in
addition to their technical specifications (brand, processor, RAM capacity, disk capacity,
etc.).
●​ Storage devices are characterized by their brand and storage capacity.

The laboratory manages multiple research projects, which are specific to the lab and involve
members from all categories for a defined period (start date and end date) and a specific workload
percentage.

For example, Karim may be assigned to the "Decision Support System" project from January 2024
to June 2025 at 60% of his working time.

A project is characterized by a code, name, budget, launch date, and duration. Each project has
one leader and up to five members.

Projects can be of two types:

●​ PRFU
●​ PNR, which must be carried out in partnership with an economic partner (a company in a
specific sector).

Question: Develop the corresponding class diagram.


USTHB​ ​ ​ ​ ​ ​ ​ ​ 3rd Year of Computer Engineering
Computer Science Faculty​ ​ ​ ​ ​ ​ ​ Module: BDA
2024/2025
Exercise 4:
We consider an automatic gearbox of a car.​
At startup, the gearbox is in neutral.

●​ Reverse gear and parking position can be engaged from neutral.


●​ First forward gear can also be engaged from neutral.
●​ However, the other forward gears (second and third) are engaged sequentially:
○​ 1 → 2 → 3 for acceleration.
○​ 3 → 2 → 1 for deceleration.
●​ Only reverse gear, parking position, and first forward gear can be shifted directly back to
neutral.

Question: Draw the corresponding state transition diagram.

Exercise 5:

Define an ODL schema for the following scenario:

●​ A Company has multiple Departments.


●​ Each Department has a name and a location.
●​ A Department can have many Employees, but each Employee works in only one
Department.
●​ An Employee has the following attributes:
○​ empId (unique identifier)
○​ name (string)
○​ age (integer)
○​ salary (float)
●​ Employees can be assigned to multiple Projects.
●​ A Project has:
○​ projId (unique identifier)
○​ title (string)
○​ budget (float)
1.​ Define the ODL Schema
○​ Define classes for Department, Employee, and Project.
○​ Specify attributes and relationships.
2.​ Write OQL queries for the following:
➔​ List all departments along with their locations.
➔​ Count the number of employees in each department.
➔​ Find the average salary of employees in the "IT" department.
➔​ List all employees working on the project titled "Alpha".
➔​ Find the total budget for projects handled by the "HR" department.
➔​ List employees who are under 30 years old and earn more than the average
salary in their department.

You might also like