Professional Documents
Culture Documents
Implementing a database for both inventory management and customer relationship management
would not only streamline operations but also enable the bakery to provide a more personalized and
efficient service to its customers. It would also facilitate data-driven decision-making, which is
crucial for the bakery's growth and success in a competitive market.
1. (b) fast food restaurant
Customer
Order
MenuItem
Employee
Ingredient
Location
In database terminology, "degree" refers to the number of attributes (or columns) in a relation (table)
in a database. It indicates how many properties or characteristics are associated with each tuple (row)
in a relation.
For example, if you have a relation named "Employees" with attributes like EmployeeID, FirstName,
LastName, and Position, then the degree of the "Employees" relation is 4 because it has four
attributes.
A database schema is considered the “blueprint” of a database which describes how the data may
relate to other tables or other data models. However, the schema does not actually contain data.
A schema describes the organization and storage of data in a database and defines the relationship
between various tables.
Database Schema Definition
A database schema refers to the logical and visual configuration of the entire relational database. The
database objects are often grouped and displayed as tables, functions, and relations. A schema
describes the organization and storage of data in a database and defines the relationship between
various tables. A database schema includes descriptive details of the database that can be depicted
through schema diagrams.
How are database schemas designed?
Database designers create database schemas to help programmers interact with the database
efficiently. The process of creating a database is known as data modeling. To design a database
schema, you need to gather information and arrange them into tables, rows, and columns. You need
to organize the information to make it easier to understand, relate, and use.
What is database schema design?
Database schema design provides a blueprint to develop the architecture of the database, so a
massive amount of information can be stored systematically. It also refers to the strategies and best
practices involved in constructing a database. Database schema design makes the data much easier to
consume, interpret, and retrieve by organizing it into separate entities and determining the
relationships between organized entities.
How to design a database schema
Database schema design ensures data has consistent formatting, all entries have a primary key, and
important data is not excluded. A database schema can exist as visual or logical, including a set of
formulas to govern the database. Developers use these formulas and data definitions to create the
database schema.
The most common types of database schemas are outlined below:
Hierarchical model: A database schema with tree-like structures with child nodes attached to the
root node is hierarchical. This database schema model can store nested data, including family trees.
Flat model: A flat model organizes data into a single or two-dimensional array-like in a spreadsheet
with rows and columns. The model is appropriate for simple data without complex relations that can
be arranged in tabular format.
Relational model: The relational model is similar to a flat model in which data is organized into
tables, rows, and columns. However, in this model, you can define relationships between different
entities.
Star schema: A star database schema organizes data into "dimensions" and "facts." Dimensions
include descriptive data, while facts have numeric values.
Snowflake schema: The snowflake database schema is a logical representation of data in a database.
The representation of this type of schema is similar to snowflake, where multiple dimensions are
attached to a single centralized fact table.
Network model: A network database schema includes data as multiple nodes connected. This model
is used to accomplish specific tasks as it allows complex connections such as many-to-many
relationships.
Foreign key
It links two tables together. This means that the foreign key in one table may refer to the primary key
of another table.
There can be more than one foreign key in a table.
The foreign key column accepts a null value.
It can make a parent-child relationship in a table.
Duplicate values can be stored in the foreign key column.
Composite key
This type of primary key consists of two or more attributes, such as multiple columns.
The data types of different columns could differ from each other.
It becomes the composite key when more than a single column is used to uniquely identify each row
in the table.
Data Integrity
Data integrity is the overall accuracy, completeness, and consistency of data.
When the integrity of data is secure, the information stored in a database will remain complete,
accurate, and reliable, no matter how long it’s stored or how often it’s accessed.
Types of data integrity
Maintaining data integrity requires an understanding of the two types of data integrity: physical
integrity and logical integrity.
Physical integrity
Physical integrity is the protection of the completeness and accuracy of that data as it’s stored,
maintained in storage, and retrieved. When natural disasters strike, the power goes out, or a disk
drive crashes, the physical integrity of data is compromised. Human error, storage erosion, and a host
of other issues can also make it impossible for data processing managers, system programmers,
applications programmers, and internal auditors to obtain accurate data.
Logical integrity
Logical integrity keeps data unchanged as it’s used in different ways in a relational database. Logical
integrity protects data from human error and hackers as well, but in a much different way than
physical integrity does. There are four types of logical integrity:
Entity integrity. Entity integrity relies on the creation of primary keys — the unique values that
identify pieces of data — to ensure that data isn’t listed more than once and that no field in a table is
null. It’s a feature of relational systems which store data in tables that can be linked and used in a
variety of ways.
Referential integrity. Referential integrity refers to the series of processes that make sure data is
stored and used uniformly. Rules embedded into the database’s structure about how foreign keys are
used ensure that only appropriate changes, additions, or deletions of data occur. Rules may include
constraints that eliminate the entry of duplicate data, guarantee that data entry is accurate, and/or
disallow the entry of data that doesn’t apply.
Domain integrity. Domain integrity is the collection of processes that ensure the accuracy of each
piece of data in a domain. In this context, a domain is a set of acceptable values that a column is
allowed to contain. It can include constraints and other measures that limit the format, type, and
amount of data entered.
User-defined integrity. User-defined integrity involves the rules and constraints created by the user
to fit their particular needs. Sometimes entity, referential, and domain integrity aren’t enough to
safeguard data. Often, specific business rules must be taken into account and incorporated into data
integrity measures.
Data integrity is not data security
Data security is the collection of measures taken to keep data from getting corrupted. It incorporates
the use of systems, processes, and procedures that restrict unauthorized access and keep data
inaccessible to those who may wish to use it in harmful or unintended ways. Breaches in data
security may be small and easy to contain or large and capable of causing significant damage.
While data integrity is concerned with keeping information intact and accurate for the entirety of its
existence, the goal of data security is to protect information from outside attacks. Data security is but
one of the many facets of data integrity. Data security is not broad enough to include the many
processes necessary for keeping data complete and accurate over time.
6. (a) Woof Walkers is a local dog walking service that will walk owners’ pets
throughout the day.
The cost of the service for each dog is included in the dog’s details. A dog
walker is given a walk rota each day which lists the dog(s) that they have to
walk.
Customer
customerID
firstName
lastName
contactInfo(email, phone)
address
DogWalker
walkerID
firstName
lastName
emailAddress
phoneNumber
available
Dog
dogID
name
breed
age
size
medicalCondition
(dog-customer one-to-many relationship)
Walk/ Rota
walkerName
dogName
dateTime
duration
location
specialInstruction
WalkSchedule
scheduleID
date
time
duration
(walker – walkSchedule one-to-many relationship walker can have
Many schedule)
Booking
bookingID
customerID
dogID
scheduleID
Relationships:
Each booking will be associated with one customer, one dog, and one schedule. This forms a many-
to-one relationship between Customer, Dog, Walk Schedule, and Booking.
These entities and their relationships should provide a good starting point for creating your ER
diagram for the dog walking service. Keep in mind that this is a simplified representation and there
may be additional attributes or entities depending on the specific requirements of the service.
A "walk rota" typically refers to a schedule or roster that outlines the planned or assigned walking
shifts for individuals responsible for tasks like dog walking, particularly in professional dog walking
services or animal care facilities.
In the context of a dog walking service, a walk rota would include information such as:
Walker's Name: The person responsible for the walk.
Date and Time: When the walk is scheduled to take place.
Duration: How long the walk is expected to last.
Dog(s): The name(s) or ID(s) of the dog(s) scheduled for the walk.
Special Instructions: Any specific requirements or instructions for each dog on the walk.
Location: Where the walk will take place.
The purpose of a walk rota is to ensure that each dog receives their scheduled walk, and that walkers
have a clear plan for their responsibilities. It helps in managing resources, maintaining a structured
routine for the dogs, and ensuring that no dog is overlooked.
For a professional dog walking service, efficient use of a walk rota can be crucial in providing high-
quality care and services to clients and their pets. It also aids in managing the availability of walkers,
allowing for better planning and coordination.
7. (a) As part of the design stage of a database a CRUD matrix will be used. What
does CRUD mean and provide a clear example for each function.
CRUD is an acronym that stands for Create, Read, Update, and Delete. It is a fundamental concept
in database management and represents the four basic functions that can be performed on data within
a database.
Create:
Function: Create involves adding new data records to a database.
Read:
Function: Read involves retrieving or viewing existing data from a database.
Update:
Function: Update involves modifying or changing existing data records in a database.
Delete:
Function: Delete involves removing existing data records from a database.
8. (c) Hardware, software and people are said to be components of the DBMS
environment.
Describe what is meant by ‘people’, ensuring you provide a concise answers.
We can identify five major components in the DBMS environment:
1. hardware,
2. software,
3. data,
4. procedures, and
5. people
Hardware
The DBMS and the applications require hardware to run. The hardware can range from
a single personal computer, to a single mainframe, to a network of computers. The particular
hardware depends on the organization’s requirements and the DBMS used. Some
DBMSs run only on particular hardware or operating systems, while others run on a wide
variety of hardware and operating systems. A DBMS requires a minimum amount of main
memory and disk space to run, but this minimum configuration may not necessarily give
acceptable performance.
Software
The software component comprises the DBMS software itself and the application programs,
together with the operating system, including network software if the DBMS is being used
over a network.
Data
The most important component of the DBMS environment, certainly from the end-users’ point of
view, is the data. The database contains both the operational data and the metadata, the ‘data about
data’. The structure of the database is called the schema.
Procedure
Procedures refer to the instructions and rules that govern the design and use of the database. The
users of the system that manage the database require documented procedures on how to use or run
the system. These may consist of instructions on how to:
- log on to the DBMS;
- use a particular DBMS facility or application program;
- start and stop the DBMS;
- make backup copies of the database;
- handle hardware or software failures. This may include procedures on how to identify
the failed component, how to fix the failed component (for example, telephone the
appropriate hardware engineer) and, following the repair of the fault, how to recover the
database;
- change the structure of a table, reorganize the database across multiple disks, improve
performance, or archive data to secondary storage.
People
The fifth component of the DBMS environment: the people.
We can identify four distinct types of people that participate in the DBMS environment:
Data and database administrators,
Database designers,
Application developers, and
End-users.
Application Developer
Once the database has been implemented, the application programs that provide the
required functionality for the end-users must be implemented. This is the responsibility of
the application developers. Each program contains statements that request the DBMS to perform
some operation on the database. This includes retrieving data, inserting, updating, and deleting data.
End User
The end-users are the ‘clients’ for the database. End-users can be classified according to the way
they use the system:
Naïve users are typically unaware of the DBMS. They access the database through
specially written application programs that attempt to make the operations as simple as
possible. They invoke database operations by entering simple commands or choosing
options from a menu. This means that they do not need to know anything about the
database or the DBMS. For example, the checkout assistant at the local supermarket
uses a bar code reader to find out the price of the item. However, there is an application
program present that reads the bar code, looks up the price of the item in the database,
reduces the database field containing the number of such items in stock, and displays
the price on the till.
Sophisticated users. At the other end of the spectrum, the sophisticated end-user is
familiar with the structure of the database and the facilities offered by the DBMS.
Sophisticated end-users may use a high-level query language such as SQL to perform
the required operations. Some sophisticated end-users may even write application programs for their
own use.
The Database Management System (DBMS) environment consists of various components that work
together to facilitate the management and utilization of databases. These components include:
Hardware:
This includes the physical equipment required to host and run the DBMS. It encompasses servers,
storage devices, networking components, and other computing resources.
Software:
DBMS Software: The actual DBMS software itself, which provides the interface and tools for
creating, managing, and interacting with databases.
Operating System: The underlying operating system on which the DBMS software runs.
Data:
The actual information stored in the databases, including structured data (e.g., tables, records) and
potentially unstructured data (e.g., documents, images).
Procedures:
These are the set of instructions or rules that guide the users and administrators in performing
specific tasks related to the database. This can include data entry protocols, backup and recovery
procedures, and more.
Users:
Database Administrators (DBAs): Responsible for the overall management, configuration, and
maintenance of the DBMS environment. They handle tasks like backups, security, and performance
optimization.
Database Developers: Responsible for designing and implementing the database schema, creating
queries, and writing code to interact with the database.
End Users: These are the individuals or applications that interact with the database to retrieve,
update, and analyze data. They may have varying levels of access and permissions.
Application Programs:
These are software programs that interact with the database using APIs (Application Programming
Interfaces) provided by the DBMS. Application programs include web applications, desktop
applications, and other software that utilize the database for data storage and retrieval.
Query Language:
This is a language provided by the DBMS for users and applications to interact with the database.
SQL (Structured Query Language) is one of the most common query languages used in relational
database management systems.
Security and Authorization:
This component encompasses the mechanisms and protocols in place to ensure that only authorized
users have access to the database. It includes user authentication, access control, encryption, and
auditing.
Backup and Recovery:
These processes and procedures ensure that data is regularly backed up and can be restored in case of
accidental deletion, data corruption, or system failures.
Concurrency Control:
This component manages simultaneous access to the database by multiple users or applications to
prevent conflicts and maintain data consistency.