Uploaded by csajiizajii

e187041-database-assingment-final (1)

advertisement
lOMoARcPSD|27130093
E187041 Database Assingment Final
HND in Computing (ESOFT Metro Campus)
Studocu is not sponsored or endorsed by any college or university
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
lOMoARcPSD|27130093
UNIT 04
Database Design and Development
Assignment 01
Shehan Kavishka
5-20-2023
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
lOMoARcPSD|27130093
Higher Nationals
Internal verification of assessment decisions – BTEC (RQF)
INTERNAL VERIFICATION – ASSESSMENT DECISIONS
Programme title
BTEC HND in Computing
Assessor
Unit(s)
Internal
Verifier
Unit 04: Database Design & Development
Assignment title
Database Solution for Quiet Attic Films
Student’s name
Shehan Kavishka
List which assessment
criteria the Assessor has
awarded.
Pass
Merit
Distinction
INTERNAL VERIFIER CHECKLIST
Do the assessment criteria awarded
match those shown in the
assignment brief?
Is the Pass/Merit/Distinction grade
awarded justified by the assessor’s
comments on the student work?
Has the work been assessed
accurately?
Is the feedback to the student:
Give details:
• Constructive?
• Linked to relevant assessment
criteria?
• Identifying opportunities for
improved performance?
• Agreeing actions?
Does the assessment decision need
amending?
Y/N
Y/N
Y/N
Y/N
Y/N
Y/N
Y/N
Y/N
Assessor signature
Date
Internal Verifier signature
Programme Leader signature (if
required)
Date
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
Date
1
lOMoARcPSD|27130093
Confirm action completed
Remedial action
taken
Give details:
Assessor signature
Date
Internal
Verifier
signature
Date
Programme
Leader signature
(if required)
Shehan Kavishka
Date
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
2
lOMoARcPSD|27130093
Higher Nationals - Summative Assignment Feedback Form
E187041
Student Name/ID
Unit Title
Unit 04: Database Design & Development
Assignment
Number
1
Assessor
Date
Received 1st
submission
Submission Date
Date Received 2nd
submission
Re-submission Date
Assessor Feedback:
LO1 Use an appropriate design tool to design a relational database system for a
substantial problem
Pass, Merit &
Distinction Descripts
P1
M1
D1
LO2 Develop a fully functional relational database system, based on an existing system
design
Pass, Merit &
Distinction Descripts
P2
P3
M2
M3
D2
LO3 Test the system against user and system requirements.
Pass, Merit &
P4
M4
D2
Distinction Descripts
LO4 Produce technical and user documentation.
Pass, Merit &
P5
M5
D3
Distinction Descripts
Grade:
Assessor Signature:
Date:
Resubmission Feedback:
Grade:
Assessor Signature:
Date:
Internal Verifier’s Comments:
Signature & Date:
* Please note that grade decisions are provisional. They are only confirmed once internal
and external moderation has taken place and grades decisions have been agreed at the
assessment board.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
3
lOMoARcPSD|27130093
Assignment Feedback
Formative Feedback: Assessor to Student
Action Plan
Summative feedback
Feedback: Student to Assessor
Assessor
signature
Date
Student
signature
Date
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
4
lOMoARcPSD|27130093
Pearson Higher Nationals in
Computing
Unit 04: Database Design & Development
Assignment 01
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
5
lOMoARcPSD|27130093
General Guidelines
1. A Cover page or title page – You should always attach a title page to your assignment.
Use previous page as your cover sheet and make sure all the details are accurately filled.
2. Attach this brief as the first section of your assignment.
3. All the assignments should be prepared using a word processing software.
4. All the assignments should be printed on A4 sized papers. Use single side printing.
5. Allow 1” for top, bottom , right margins and 1.25” for the left margin of each page.
Word Processing Rules
The font size should be 12 point, and should be in the style of Time New Roman.
Use 1.5 line spacing. Left justify all paragraphs.
Ensure that all the headings are consistent in terms of the font size and font style.
Use footer function in the word processor to insert Your Name, Subject,
Assignment No, and Page Number on each page. This is useful if individual sheets
become detached for any reason.
5. Use word processing application spell check and grammar check function to help
editing your assignment.
1.
2.
3.
4.
Important Points:
1. It is strictly prohibited to use textboxes to add texts in the assignments, except for the
compulsory information. eg: Figures, tables of comparison etc. Adding text boxes in
the body except for the before mentioned compulsory information will result in
rejection of your work.
2. Carefully check the hand in date and the instructions given in the assignment. Late
submissions will not be accepted.
3. Ensure that you give yourself enough time to complete the assignment by the due date.
4. Excuses of any nature will not be accepted for failure to hand in the work on time.
5. You must take responsibility for managing your own time effectively.
6. If you are unable to hand in your assignment on time and have valid reasons such as
illness, you may apply (in writing) for an extension.
7. Failure to achieve at least PASS criteria will result in a REFERRAL grade .
8. Non-submission of work without valid reasons will lead to an automatic RE FERRAL.
You will then be asked to complete an alternative assignment.
9. If you use other people’s work or ideas in your assignment, reference them properly
using HARVARD referencing system to avoid plagiarism. You have to provide both
in-text citation and a reference list.
10. If you are proven to be guilty of plagiarism or any academic misconduct, your grade
could be reduced to A REFERRAL or at worst you could be expelled from the course
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
6
lOMoARcPSD|27130093
Student Declaration
I hereby, declare that I know what plagiarism entails, namely to use another’s work and to
present it as my own without attributing the sources in the correct form. I further understand
what it means to copy another’s work.
1. I know that plagiarism is a punishable offence because it constitutes theft.
2. I understand the plagiarism and copying policy of Edexcel UK.
3. I know what the consequences will be if I plagiarise or copy another’s work in any of
the assignments for this program.
4. I declare therefore that all work presented by me for every aspect of my program, will
be my own, and where I have made use of another’s work, I will attribute the source in
the correct way.
5. I acknowledge that the attachment of this document signed or not, constitutes a binding
agreement between myself and Pearson, UK.
6. I understand that my assignment will not be considered as submitted if this document
is not attached to the assignment.
shehan.k98@gmail.com
Student’s Signature:
(Provide E-mail ID)
Shehan Kavishka
20/05/2023
Date:
(Provide Submission Date)
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
7
lOMoARcPSD|27130093
Higher National Diploma in Computing
Assignment Brief
Student Name /ID Number
Shehan Kavishka
Unit Number and Title
Unit 4: Database Design & Development
Academic Year
2022/23
Unit Tutor
Assignment Title
Data base system for Quiet Attic Films
Issue Date
Submission Date
IV Name & Date
Submission format
Part 1: The submission should be in the form of an individual written report written in a concise,
formal business style using single spacing and font size 12. You are required to make use of
headings, paragraphs and subsections as appropriate, and all work must be supported with
research and referenced using Harvard referencing system. Please also provide in-text citation
and bibliography using Harvard referencing system. The recommended word limit is 3,000–
3,500 words, although you will not be penalised for exceeding the total word limit.
Part 2: The submission should be in the form of a fully functional relational database system
demonstrated to the Tutor; and an individual written report (please see details in Part 1 above).
Part 3: The submission should be in the form of a witness statement of the testing completed by
the Tutor; technical documentation; and a written report (please see details in Part 1 above).
Unit Learning Outcomes:
LO1 Use an appropriate design tool to design a relational database system for a substantial
problem.
LO2 Develop a fully functional relational database system, based on an existing system design.
LO3 Test the system against user and system requirements.
LO4 Produce technical and user documentation.
Assignment Brief and Guidance:
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
8
lOMoARcPSD|27130093
Assignment brief
Quiet Attic Films is a film production company based in London, England who specialize in
making short information films and advertisements for television. They want you to design
and implement a database that meets the requirements for their data. These requirements are
specified in this scenario and the examples of paper documents kept by the company shown
below.
Quiet Attic Films organize their data around the concept of a ‘production’. A production is
specified as being for a particular client; but note that a client might have more than one
production at any time. A production will take place at one or more locations. A production
will also use a number of, what are called, properties, which might be anything from an
actual property like a building, to costumes or small items of any sort. It is important to keep
a record of which properties are required at which location.
There should also be a record kept of the staff types that are assigned to productions
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
9
lOMoARcPSD|27130093
Activity 1
Identify the user and system requirements to design a database for the above scenario and
design a relational database system using conceptual design (ER Model) by including
identifiers (primary Key) of entities and cardinalities, participations of relationships. Convert
the ER Model into logical database design using relational database model including primary
keys foreign keys and referential Integrities.
It should contain at least five interrelated tables. Check whether the provided logical design
is normalised. If not, normalize the database by removing the anomalies.
(Note:-It is allowed to have your own assumptions and related attributes within the scope
of the case study given)
Design set of simple interfaces to input and output for the above scenario using Wireframe or
any interface-designing tool. Evaluate the effectiveness of the given design (ERD and Logical
design) in terms of the identified user and system requirements.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
10
lOMoARcPSD|27130093
Activity 2
Develop a relational database system according to the ER diagram you have created (Use
SQL DDL statements). Provide evidence of the use of a suitable IDE to create a simple
interface to insert, update and delete data in the database. Implement proper security
mechanisms in the developed database and evaluate the database solution developed in terms
of its effectiveness with relevance to the user and system requirements identified, system
security mechanisms (EX: -User groups, access permissions) and the maintenance of the
database. Suggest improvements for any identified problems.
Assess the usage of the below SQL statements with the examples from the developed database
to prove that the data extracted through them are meaningful and relevant to the given
scenario.
Select/ Where / Update / Between / In / Group by / Order by / Having
Activity 3
3.1 Provide a suitable test plan to test the system against user and system requirements.
provide relevant test cases for the database you have implemented. Assess how the selected
test data can be used to improve the effectiveness of testing.
Note:- Learner needs to give expected results in a tabular format and screenshots of the
actual results with the conclusion
3.2 Get independent feedback on your database solution from the non-technical users and
some developers (use surveys, questioners, interviews or any other feedback collecting
method) and make a separate conclusion from the feedbacks.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
11
lOMoARcPSD|27130093
Activity 4
Produce technical and user documentation for a fully functional system, including data flow
diagrams showing movement of data through the system, and flowcharts describing how the
system works. Evaluate the developed database by suggesting future enhancements to ensure
the effectiveness of the system.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
12
lOMoARcPSD|27130093
Contents
User Requirements .............................................................................................................................. 14
System Requirements .......................................................................................................................... 14
Security Requirements ........................................................................................................................ 15
Designing ER Diagram ....................................................................................................................... 15
ER Diagram ......................................................................................................................................... 16
ER Diagram Explanation ................................................................................................................... 17
Logical Database ................................................................................................................................. 18
Logical Database Explanation............................................................................................................ 19
Normalization ...................................................................................................................................... 20
Update Anomalies ............................................................................................................................... 20
Deletion Anomalies .............................................................................................................................. 21
1st Normal form .................................................................................................................................. 21
2nd Normal form and 3rd Normal form ........................................................................................... 22
Set of simple interfaces using wireframe. .......................................................................................... 25
Effectiveness of the given ERD and the Logical Design ................................................................... 29
Logical Database Design Evaluation: ................................................................................................ 29
What is SQL......................................................................................................................................... 30
Creating the Database ......................................................................................................................... 31
Implementation of security mechanisms ........................................................................................... 44
Implementation of security mechanisms Part 2 – Creating views .................................................. 49
create a simple interface to insert, update and delete data in the database ................................... 55
Database Solution Evaluation: ........................................................................................................... 58
Database Solution Improvement: ...................................................................................................... 59
Checking the SQL statements ............................................................................................................ 60
Test plan ............................................................................................................................................... 67
Test case ............................................................................................................................................... 68
LOGIN INTERFACE ......................................................................................................................... 69
HR privilege ......................................................................................................................................... 71
Feedback form ..................................................................................................................................... 79
Technical Documentation ................................................................................................................... 85
Database Design: ................................................................................................................................. 85
Use case diagram ................................................................................................................................. 88
Class diagram ...................................................................................................................................... 89
DFD Level 0 ......................................................................................................................................... 90
DFD Level 1 ......................................................................................................................................... 90
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
13
lOMoARcPSD|27130093
Activity 1
a. Identify the User and system requirements
User Requirements
User requirements are a set of instructions provided by the user that describe what functions
the system should be able to do.
Quiet Attic Films organize their data around the Concept of ‘Production’.
‘Production’ is specific to one ‘Client’ but ‘Client’ can have many ‘Productions’ at
one time.
Production take place in one or more Locations.
Production can have many Properties (Example – car, bike, buildings)
Which properties are needed where should be recorded in the database.
They need to kept a record of staff types that assigned to the productions.
The data should be secured.
Adding a new employee
Calculate the employee salary
Calculate the total production cost
Database should allow user to generate reports and export data in various formats.
The database should allow users to create, update, and delete records for productions,
clients, locations, properties, and staff types.












System Requirements
Technical specifications known as "system requirements" are typically provided in terms of
"hardware requirements" and "software requirements."







The company need the computers to run the Database.
Need someone to manage the Database.
A relational database model should be used to create the database.
The database must to make it simple to query and report on data.
Can store the data that need to the production company
The database should be scalable and able to handle increasing amounts of data over
time.
The database should be able to store a large amount of data, including information
about many clients, productions, locations, properties, and staff types.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
14
lOMoARcPSD|27130093
In order to run this database system Quiet Attic Films will need to meet following system
requirements:
Operating system: Windows 7 or Higher
Hard Disk Space: 100GB
Ram: 4GB (Minimum)
MySQL Server.
Security Requirements




To make sure that only people with permission may access the data, the database
needs to have reliable authentication procedures.
To guarantee that users can only access data that they are permitted to see or alter, the
database should implement access rules.
To avoid unwanted access or theft, the database should encrypt important data, such
as client and employee information.
The database should include auditing and logging features to keep track of user
activity and find any instances of unauthorized access or data change.
Designing ER Diagram
Entities and Fields.
Entity
Field
Production
Production_ID, Prodction_type, Days, Client_IDFK
Client
Client_ID, Client_name, Client_Address, Client_Num
Location
Location_ID, Location_Name, Location_State
Property
Property_ID, Property_Type, Property_Description
Staff Details
Staff_ID, Staff_Name, Staff_Address, Role_IDFK
Staff payment
Role_ID, Role, Amount
FK – Foreign Key
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
15
lOMoARcPSD|27130093
ER Diagram
Figure 1 - ER Diagram
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
16
lOMoARcPSD|27130093
ER Diagram Explanation
We Created 6 interrelated tables.
 Client_Details
 Production
 Staff_details
 Location
 Staff_Payment
 Property

Client and Production has one to Many Relationship. Because in the there is clearly
mentioned one Client could have many Productions at the same time.

Production and Location has Many to Many relationship. In the table we can see some
productions have 2 different location and we assume that there can be many
productions at one location.

Location and Property has Many to Many relationship. There is a lot of properties for
example there could be more than one car in the film production company. In this case
we assume that there will be same property type present in the different locations.

Production and Staff Details. In this case we put the relationship type as Many to
Many. Because we assume that one staff for example a Camera crew member can
involve in the two different productions for some reasons. On the other hand, we look
in to staff type. Production can have many camera crew members, and camera crew
members can also participate in other productions.

Staff Payment and Staff Details has One to Many relationship. Because payment is
different within staff type. One staff can have only one staff type. For example, camera
crew member payment and runner payment are different.
 Client address and the staff address are composite attribute.
 We assume that each client and the staff can have one phone number. If not, we can
change the phone numbers as multivalued attributes. In this case we put it as one
phone number.
From these we can have a good ER Diagram for this film production company.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
17
lOMoARcPSD|27130093
Logical Database
Figure 2 - Logical Database
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
18
lOMoARcPSD|27130093
Logical Database Explanation
Let us talk about each table.
Yellow key is the primary key and the red key represent the foreign key
Production Table
 Production_ID is the primary key of this table.
 Production Type and Days of the production are two attributes
 Client ID is a foreign key. We took it to join the Client tables and the Production table.
Client Details Table
 Client_ID is the primary key of this table.
 Client name and the Client phone number are the other attributes.
 We moved Client Address to another table. In the ER diagram we mentioned it as a
derived attribute.
Client Address Table
 Client_ID is a foreign key of this table because it has one to one relationship. (We
assume that one client has one address) (Primary key of the Client details table)
 City, State, and country is the other attributes of this table.
Location Table
 Location_ID is the Primary key of this table.
 Location name and the state of the location are the other attributes of this table.
 Important --> Location and Production has a Many to Many relationship. We talk
about that earlier. Because of that to connect both tables we use a Junction table. It
contains the primary key of the both tables.
 In this case we named that table as Production_take in _locations and we put the
primary keys of both tables in to that table.
 That is the method for connecting Many to Many relationship tables.
Property Table
 Property_ID is the Primary key of this table.
 Type of the Property and the Description of the Property are the other attributes.
 We now know that Property and the Location tables has Many to Many relationship.
Because of that we use a junction table for join these two tables.
 We named that junction tables as Location have property and we put the primary key
of both tables to this table.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
19
lOMoARcPSD|27130093
Staff Details Table
 Staff_ID is the Primary key of this table.
 Staff name is another attribute
 We use Role_ID as a foreign key of the staff table. That is to connect the staff Payment
table and the staff table. (Primary key of the Staff Payment Table)
Staff address Table
 We put a Staff address into another table and that has one to one relationship.
 For that we use staff_ID as a foreign key and street as an attribute. (Primary key of the
Staff Details Table)
Staff Payment Table
 Role_ID is the Primary key of this table.
 Role and the Amount per day is the other attributes of this table.
 We know that Staff table and the production table has Many to Many relationship.
 For that we create another junction table called Production has staff.
 For that we include the both primary keys of those tables.
Normalization
Data in a database can be organized using a process called "Database normalization". In this
case the database is not normalized and it doesn’t well organized. First, let us see what happen
if the database is not normalized.
It will take up more memory if a database is not normalized and does not have redundant
data, and it will also be challenging to manage and update the database without risking data
loss.
If a database is not normalized Insertion, Update, and Deletion Anomalies happen commonly.
Insertion Anomalies


If there will be a new client and if they do not finalize the location, when we filling
the database with data there will be Null values in the location field.
Also if we need to put another staff member (Production manager) for all the records
we need to insert it into all the records one by one.
This is the insertion anomaly.
Update Anomalies

What if River Cam, Cambridge location is not available for the all production and we
need to change those production to another place. In this case we need to find the all
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
20
lOMoARcPSD|27130093
insertions and update one by one. If we miss a record it may cause to a data
inconsistency
This is Update Anomaly
Deletion Anomalies

In the given Database there is several different information at one table. For example,
there is Client Details in the Production table. If we delete a production from that we
loss client details and the other details also.
This is Deletion Anomaly
There are 5 different normal forms. But when we doing 3rd normal form there are good chance
to normalize the database.
1st Normal form
For a table to be in the first normal form, it needs to satisfy 3 rules.
1. Only single(atomic) valued attributes and columns should be present.
2. A column's values must belong to the same domain.
3. All the tables must have unique names
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
21
lOMoARcPSD|27130093
Let us turn this table into 1st normal form.
Location
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
Greenwich Park,London
windsor castle grounds
windsor castle grounds
windsor castle grounds
windsor castle grounds
windsor castle grounds
windsor castle grounds
windsor castle grounds
River cam,Cambridge
River cam,Cambridge
River cam,Cambridge
River cam,Cambridge
River cam,Cambridge
Quiet Attic Studio
Quiet Attic Studio
Quiet Attic Studio
Quiet Attic Studio
Quiet Attic Studio
St James's park, London
St James's park, London
St James's park, London
St James's park, London
St James's park, London
Production ID Client
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
2 Epom motors
6 MOAF
6 MOAF
6 MOAF
6 MOAF
6 MOAF
6 MOAF
6 MOAF
6 MOAF
6 MOAF
6 MOAF
7 MOAF
7 MOAF
7 MOAF
7 MOAF
7 MOAF
Production Type
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Information Film
Information Film
Information Film
Information Film
Information Film
Information Film
Information Film
Information Film
Information Film
Information Film
Training Film
Training Film
Training Film
Training Film
Training Film
1NF
Staff
camera crew
camera crew
Runnr
producer
actor
actor
actor
camera crew
camera crew
Runnr
producer
actor
actor
actor
camera crew
camera crew
Runnr
producer
actor
actor
actor
camera crew
camera crew
runner
producer
voice actor
camera crew
camera crew
runner
producer
voice actor
camera crew
camera crew
runner
producer
voice actor
Properties
vehical
vehical
vehical
vehical
vehical
vehical
vehical
car
car
car
car
car
car
car
vehical
vehical
vehical
vehical
vehical
vehical
vehical
none
none
none
none
none
none
none
none
none
none
Tractor
Tractor
Tractor
Tractor
Tractor
Number of days
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2nd Normal form and 3rd Normal form


For that first table need to be in the first normal form.
And, it should not have Partial Dependency.
To avoid any partial dependencies on the Production table, the 2NF structure separates the
Location, Staff, Property, and Client data into independent tables. Each have primary keys
and some foreign keys.
Production Table
Production_ID
2
6
7
Shehan Kavishka
Client_ID
C_01
C_02
C_02
Type
Advertisement
Information Film
Training Film
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
Days
5
1
2
22
lOMoARcPSD|27130093
Client Table
C_01
C_02
Client_ID
Client Name
Epom Motors
MOAF
Phone number
44745128
253152533
Client Address
Client_ID
C_01
C_02
City
110 East St
120 West st
State
Epsom KT17 1EZ
Whitehall Place
Country
UK
UK
Location Table
LO_1
LO_2
LO_3
LO_4
LO_5
Location_ID
Location name
Greenwich Park
Windsor castle grounds
River cam
Quiet Attic Studio
St James’s Park
London
Cambridge
London
London
London
State
Property Table
Property_ID
Pb_01
Pb_02
Pf_01
Pf_02
Pv_01
Pv_02
Pv_03
Type
Building
Building
Furniture
Furniture
Vehicle
Vehicle
Vehicle
Description
Suburban House
Inner City House
Chair
Table
Car
Tractor
Boat
Staff Details Table
E01
E02
E03
E04
E05
E06
E07
STAFF_ID
Shehan Kavishka
Shaun
Kenneth
Kevin
Brian
Thomas
George
James
NAME
1
3
5
1
2
2
4
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
Role_ID
23
lOMoARcPSD|27130093
Staff address
STAFF_ID
Address
780 Linden Ave.
594 Wagon Dr.
9146 East Olive Ave.
66 Winding Way St.
E01
E02
E03
E04
Staff Payment
1
2
3
4
5
Role_ID
Role
CAMERA_CREW
RUNNER
ACTOR
VOICE ACTOR
PRODUCER
100
25
200
100
550
Amount
These are the sample tables after the normalization.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
24
lOMoARcPSD|27130093
Set of simple interfaces using wireframe.
Logging page
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
25
lOMoARcPSD|27130093
Sign Up page
Place a Production
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
26
lOMoARcPSD|27130093
Client Payment Page
Project Manager View
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
27
lOMoARcPSD|27130093
HR manager interface
HR Manager view for edit, Search the Employee Details
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
28
lOMoARcPSD|27130093
Effectiveness of the given ERD and the Logical Design
 Quiet attic Films organized their data around the production. In this design the user
requirement is satisfied and production and client have that one-to-many relationship.
 The production entity has many to many relationship with the location. Production can
take place in many locations and locations can may have multiple production at one
time.
 To take the records for properties in the location, I created separate table to store
properties and joining with the location we can know which property is in witch
location.
 From this design we can know the staff details and which staff is in which production.
And also, we can calculate the salary of the staff using the count of the production days
and the staff amount per day.
 Most important thing in using this design we can check the employees who are not
included in the projects. From that we can manage the employees.
 The logical design of the database should incorporate the appropriate protections to
ensure data security.
 The database can store the client details, production details, staff details, property
details, location details.
 the database can able to handle a huge volume of data properly.
 Overall, this ERD design captures the all-user requirement and the system
requirements.
The ERD is easy to read and understand, and it provides a clear visual representation of the
database structure.
Logical Database Design Evaluation:
 The ERD is properly converted by the logical database design into a set of tables that
may be used in a relational database management system.
 The tables' primary keys and foreign keys are used to link relevant records across
other tables in order to guarantee data integrity and prevent data duplication.
 Referential integrity constraints are also part of the logical design to guarantee
appropriate maintenance of data linkages between tables.
 Because of the logical design, each attribute in the tables has the proper data types
and field widths.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
29
lOMoARcPSD|27130093
Activity 2
Develop a relational database system according to the ER diagram you have created (Use
SQL DDL statements).
What is SQL
SQL mean Structured Query Language. That is a programming language used to manage and
manipulate relational database. SQL offers a standardized method of communicating with
databases. This means that similar SQL queries can be used with many DBMS, including
MySQL, Oracle, and Microsoft SQL Server.
SQL is made up with 4 different types of statements.
DDL: Data Definition Language. This used to create and modify the Database objects like
create views, tables.
EG: CREATE TABLE: to create new table
ALTER TABLE: modify the existing table
DROP TABLE: Remove or Drop a table
DML: Data Manipulation Language. This used to update, insert, manipulate the data.
EG: INSERT INTO: insert new data to the table
UPDATE: Modify existing data in the table
DELETE: Remove data from the table
DQL: Data Query Language. This used for pull out the data from the table using SELECT
statement.
EG: SELECT: Pull out the data from one or more tables
JOIN: combine data from two or more tables
DCL: Data Control Language. This used to manage the database security, privilege, and
access control.
EG: GRANT: Give a permission to perform certain action in the database
REVOKE: remove the permission
We using the MYSQL for create the database and insert the data.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
30
lOMoARcPSD|27130093
Creating the Database
For that we use CREATE DATABASE statement
After creating the database, we need to access the created database. For that we can use, USE
command.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
31
lOMoARcPSD|27130093
Now we are in the quit attic film database. Now we need to create the tables.
Creating the CLIENT TABLE
Creating the CLIENT_ADDRESS TABLE
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
32
lOMoARcPSD|27130093
Creating the PRODUCTION TABLE
Creating the LOCATION TABLE
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
33
lOMoARcPSD|27130093
Creating the PROPERTY TABLE
Creating the STAFF PAYMENT TABLE
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
34
lOMoARcPSD|27130093
Creating the STAFF TABLE
Creating the STAFF_ADDRESS TABLE
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
35
lOMoARcPSD|27130093
 For best practice we are putting semicolon ( ; ) after every query we are writing.
 We need to put PRIMARY KEY statement for mention the attribute as the primary
key.
 And, for a foreign key we need to put FOREIGN KEY after that we need to put the
REFERENCES statement. From that wee need to put from where we got the
attribute.
 For a FOREIGN KEY its very important to know when we are putting it a table the
attribute must be same size and same type.
 For creating a table, we use CREATE TABLE statement.
 VARCHAR means the data type and, in the brackets, we mention the length of that
attribute.
 We use NOT NULL for NOT accept NULL values. If we mention it the attribute it
cannot be empty. System will give an error message.
 We can use AUTO INCREMENT statement to automatically increase the numbers.
After creating the tables now, we need to input the data. For input the data into table we use,
INSERT INTO ( ‘ATTRIBUTES’ )
VALUES ( ‘VALUES OF THE ATTRIBUTES’ )
If we are filling the all values of the tables its not much important to pass the column names
in the brackets after the insert into command.
If we are putting certain value, we need to pass the column name. for best practice its good
to passing the all-column names in to the insert into statement.
Let us insert the values for the created tables.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
36
lOMoARcPSD|27130093
INSERT INTO CLIENT_DETAILS TABLE
INSERT INTO CLIENT_ADDRESS TABLE
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
37
lOMoARcPSD|27130093
INSERT INTO PRODUCTION TABLE
INSERT INTO LOCATION TABLE
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
38
lOMoARcPSD|27130093
INSERT INTO PROPRTY TABLE
INSERT INTO STAFF PAYMENT TABLE
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
39
lOMoARcPSD|27130093
INSERT INTO STAFF DETAILS TABLE
INSERT INTO STAFF_ADDRESS TABLE
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
40
lOMoARcPSD|27130093
Using the CREATE TABLE method we join the one to one and one many relationship
tables. But to join the Many to Many relationship, we cannot do the same thing. For that we
need to create a table called JUNCTION TABLE. In the junction table we include the
primary key of the both tables to connect both tables.
Now we need to create a junction table for these three.
 Between Production table and the Location table
 Between Location table and the Property table
 Between Production table and the Staff details table
JUNCTION TABLE Between Production table and the Location table
From creating a junction table, we can connect both location and Production tables.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
41
lOMoARcPSD|27130093
JUNCTION TABLE Location table and the Property table
JUNCTION TABLE Production table and the Staff details table
From the same method we can insert the data in to the junction tables.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
42
lOMoARcPSD|27130093
INSERT DATA INTO JUNCTION TABLE Between Production table and the Location
table
INSERT DATA INTO JUNCTION TABLE Between Location table and the Property
table
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
43
lOMoARcPSD|27130093
INSERT DATA INTO JUNCTION TABLE Production table and the Staff details
table
Like this we can insert data in to the junction table. More important thing to know is we
create a junction tables for many to many relationships.
Implementation of security mechanisms
Security mechanism of the database. For a Database a very important thing is the security
mechanism. Its very important to protect internal data of the company. In SQL there is
several ways to protect data from proper security mechanism.
In this database there is some important things to clear. For HR department Salary table is
very important. If third part person can access that table, he can change the amount per day.
Let us see how we can prevent from that kind of problems using the SQL security
mechanism.
We can use CREATE USER command to create a user for the database.
 CREATE USER 'Your name' @ 'localhost' IDENTIFIED BY 'Password';
After that we can give the access to needed tables for the user
 GRANT SELECT ON Database name. Table name TO 'Name'@'localhost';
We can give multiple privileges such as DELETE, UPDATE, INSERT like that. We need
to mention the Database name and the table name which we are giving the privileges of.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
44
lOMoARcPSD|27130093
Now we creating a user call Natasha from HR and her password.
Now we need to give the Permission to the Staff payment, staff details and staff address
tables. She is from HR, because of that we need to give full privilege to those tables.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
45
lOMoARcPSD|27130093
Now we can check the user. In SQL we need to create a new connection.
After that u need to put the password that you created.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
46
lOMoARcPSD|27130093
After Natasha Log in to the database, she can only see the tables that we gave the
permission. She cannot see the all tables in the database.
Using SHOW GRANTS statement Natasha can see the privileges of the tables.
From this we can improve our security of the database. Now let’s see how to remove the
permission from the user and delete the user account from the database.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
47
lOMoARcPSD|27130093
To Show the users in the database we can use the follow command.







SELECT user, authentication_string FROM mysql.user;
To select specific user in the database we can user WHERE statement
SELECT user, authentication_string FROM mysql.user WHERE user = ' USER
NAME ';
To remove the permission from the user REVOKE
REVOKE ALL PRIVILEGES, GRANT OPTION FROM ' USER NAME
'@'localhost';
To reload the grant tables and apply the changes
FLUSH PRIVILEGES;
But the user’s name still in the database. For that we can use to delete user from the
database
DROP USER ' USER NAME '@'localhost';
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
48
lOMoARcPSD|27130093
Implementation of security mechanisms Part 2 – Creating views
A view is a virtual table that is derived from one or more base tables or other views in a
database management system. A view gives users access to and control over data that is
included in other tables or views but does not really contain any data of its own. Views can
be used to streamline queries, conceal critical information from unauthorized users, and offer
different users or applications with tailored views of the data. It is very important to create a
view because for example client do not want to see the staff details. Like that we can create
views for client, we can decide what client need to see in the database. Important thing is
views cannot be update. We cannot do anything to the views. But when we updated the tables,
views are automatically updating the view.
Views can help improve the implementation of security mechanisms in several ways:
 By limiting which columns or rows are accessible to users or groups, views can be
used to restrict access to specific data.
 Views can be used to mask sensitive data by replacing it with fake or obfuscated data.
For example, a view might be created to show only the last four digits of a customer's
credit card number, instead of the full number, to minimize the risk of data breaches
or identity theft.
 Views can be used to simplify complex queries by predefining joins or aggregations
that would otherwise need to be performed in the query itself. This can improve query
performance and reduce the risk of errors or security vulnerabilities.
 Views can be used to enforce data consistency by defining constraints or rules that
must be satisfied by the underlying tables or views. For example, a view might be
created to show only the active employees, by defining a rule that the employee's
status field must be set to "active" in the underlying table.
By offering a mechanism to limit access, hide sensitive data, aggregate data, simplify
queries, and enforce data consistency, views can assist improve security in a database
management system. Database managers can contribute to the protection of the
confidentiality, integrity, and availability of the data by utilizing views in conjunction with
other security measures like authentication, authorization, and encryption.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
49
lOMoARcPSD|27130093
We can create some important views joining the tables.
VIEW CLIENT_INFO
VIEW COST FOR EACH PRODUCTION
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
50
lOMoARcPSD|27130093
VIEW PRODUCTION_INFO
VIEW PRODUCTION_LOCATION
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
51
lOMoARcPSD|27130093
VIEW PROPERTY FOR LOCATION
VIEW PROPERTY GOT BY EACH LOCATION
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
52
lOMoARcPSD|27130093
VIEW ROLE OF THE EACH EMPLOYEE
VIEW SALARY OF EMPLYEES
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
53
lOMoARcPSD|27130093
VIEW STAFF IN PRODUCTION
VIEW STAFF NOT ASSINGED TO A PRODUCTION
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
54
lOMoARcPSD|27130093
Like this we can see many important details creating views. We do not need to re write the
code each time. If we need to see we just need to create a view and just call select statement
for see the view.
create a simple interface to insert, update and delete data in the database
control panel for HR
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
55
lOMoARcPSD|27130093
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
56
lOMoARcPSD|27130093
Here are the sample interface for the logging, property and location management, employee
registration sample from visual studio.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
57
lOMoARcPSD|27130093
These are the interface from this we can update, Delete and Insert a record to the database.
If we talk more about the security mechanism, we can do like this.
1. Access control – the database should have strong password policies. And two factor
authentication should implement where it possible.
2. Encryption – Sensitive data should be encrypted.
3. Audit trails – logging all user activities will help to track down the suspicious
activities. And audit trial can also provide information about the logging
information’s.
4. Backup – Regular backup should be taken to prevent the data loss.
Database Solution Evaluation:
Consider the following factors when assessing the database solution:
1. Performance: The database should meet the performance requirements set by the user.
2. Security: The database needs to be safe to prevent unwanted access, modification, or
theft of the data.
3. Scalability: The database needs to be scalable in order to deal with growing user and
data loads.
4. User-Friendliness: The database should have a user-friendly interface that is simple to
use and navigate.
5. Maintenance: There should be little downtime when updating and maintaining the
database.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
58
lOMoARcPSD|27130093
Database Solution Improvement:
The following enhancements can be implemented if any issues are found during the
database solution evaluation:
1. Performance: To enhance query performance, think about optimizing the database
schema and indexing.
2. Security: Review and update the encryption techniques and access control procedures.
Consider implementing stronger security measures, such as security monitoring and
detection systems for intrusions.
3. Update the database interface to make it more user-friendly and easier to use.
 Which properties are needed where should be recorded in the database.
From the database we can retrieve the data about this requirement using a view.
 They need to keep a record of staff types that assigned to the productions.
In this database I created a view for this joining the Staff table and production table.
 Calculate the employee salary
Using joining table of production staff payment tables. We can calculate the salary of
each employee. I created a view for that also. When we change the count of days, the
salary will be automatically change.
 Calculate the total production cost
Using joining tables we can calculate the production cost also.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
59
lOMoARcPSD|27130093
Checking the SQL statements
SELECT statement. We can use select statement to fetch the data from the tables.
In this case we pull the data from a view that we already created to see the client
information joining the two tables.
WHERE statement. We cannot use where statement alone. We need to use SELECT
statement with it.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
60
lOMoARcPSD|27130093
Assume date of some production has been extended. For that kind of things, we can use
UPDATE statement to update the count of days.
BEFOR THE UPDATE
AFTER THE UPDATE
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
61
lOMoARcPSD|27130093
BETWEEN statements used for check the range. For example, production between date.
We can see the salary range between 500 and 2000. For that we use salary view.
IN statement
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
62
lOMoARcPSD|27130093
GROUP BY statement
In this picture we can see the number of staff in each production.
ORDER BY statement
in this picture we use order by statement for sort the salary of employees.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
63
lOMoARcPSD|27130093
HAVING statement
Evaluation of developed database with requirement specification
User requirement - Which properties are needed where should be recorded in the database.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
64
lOMoARcPSD|27130093
User requirement - They need to kept a record of staff that assigned to the productions.
In extra we can see each employees that are not involve to projects. We can use them to
another project.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
65
lOMoARcPSD|27130093
User requirement - Calculate the employee salary
User requirement - Calculate the total production cost
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
66
lOMoARcPSD|27130093
ACTIVITY 03
Test plan
Testing Area
Testing scope
Testing strategy
Estimated effort
Testing case ID
Security
User login
Login using
different user
credentials and
giving correct
and incorrect
passwords
1 Hour
1.1
Security
User Privileges
2 Hours
1.2
Data Integrity
Ensuring that
data is accurate,
consistent, and
complete
Trying to use
Update
statement to
Update a record
using privilege
user account
and
unprivileged
user account
Inserting data
into the
database and
verifying that it
has been stored
accurately
Updating data
in the database
and verifying
that it has been
updated
accurately
1 Hour
1.3
1 Hour
1.3.1
Backups and
Recovery
Shehan Kavishka
ensuring that
data can be
recovered in the
event of a
failure or
disaster and that
backups can be
made
Deleting data
1 Hour
from the
database and
verifying that it
has been deleted
accurately
Test to back up 3 Hours
the database and
try to restore the
database
successfully
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
1.3.2
1.4
67
lOMoARcPSD|27130093
Test case
Test
Cas
e
ID
1.1
Test case
Descripti
on
Inputs
Expected Outcome
Actual Output
Admin
Login
User
name,
Password
If the user credential is
correct the admin should
be able to login,
If incorrect the admin
should not be able login
to the system
Correct credential
allowed to login.
Incorrect
credential did not
allow the admin
to login
1.2
HR
privilege
Update the
runner
hour per
rate
If HR has the access to
update the table, he may
can update the record.
If not, error message
will show
When giving the
access to update
he can update the
record. Without
he can t to update
the record
Pass
1.3
Inserting
data
Inserting a
new
employee
If data types and all
correct data should be
recorded successfully
Data recorded
successfully
Pass
1.3.
1
Updating
a data
Updating
the days of
a
Production
If update were
successful, production
days, production cost,
salary of the employees
in that project need to be
updated
Production table,
Salary table and
production cost
were updated
successfully
pass
1.4
Backup
the Data
Create a
If backup file created
backup file properly, we can see the
of the
file in the pc
database
We can see the
backup file in
MySQL file
pass
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
Test
Result
( Pass /
Fails )
Pass
68
lOMoARcPSD|27130093
1.1 Admin Login
LOGIN INTERFACE
ENTERING WRONG CREDENTIALS
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
69
lOMoARcPSD|27130093
ENTERING THE CORRECT CREDENTIALS
When you enter the correct password, you can enter the database.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
70
lOMoARcPSD|27130093
HR privilege
I am going to create a user name mark and give him the privilege only view the payment
table. He does not have access to update the table
First, we need to create a user and give him the access
Need to create a connection in MySQL
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
71
lOMoARcPSD|27130093
Login to that connection using user name and the password that we gave
When we are trying to update the table mark cannot do that because he does not have the
privilege to do that. He only can view the table.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
72
lOMoARcPSD|27130093
When we giving the access to UPDATE the table. He may can do it.
After giving update privilege mark can change the actors pay per hour amount to 800
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
73
lOMoARcPSD|27130093
Always remember when we give a new privilege or removing a user we need to use
FLUSH PRIVILEGES; statement to apply it. Other vise you need to logout and login again.
Inserting a new employee
Now we give the permission to mark for the insert statement. From that he can insert an
employee to the database.
when you are trying to duplicate the primary key, it may show an error message. You can’t
repeat the primary key.
after inserting you can see the new employee’s name under ID E23
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
74
lOMoARcPSD|27130093
Updating the days of a Production
There is a producer in production ID 2 of Epom motors production. How ever production
days were extended from 5 to 9. When he updates the days, Epom motors cost per production
and the salary of the employees that attached to the production will also increase.
Creating a user and giving the access to the tables.
Let’s look in the production table
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
75
lOMoARcPSD|27130093
You can see the Days is 5. Now let us see the other tables before the update.
Before update, salary table.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
76
lOMoARcPSD|27130093
When he updates the Days to 9 you can see the salary of the employee and the production
cost will change accordingly.
Cost per production is changed.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
77
lOMoARcPSD|27130093
Production information has been changed.
Salary of the employee has been changing in order to days.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
78
lOMoARcPSD|27130093
Feedback form
For collect the feedbacks I used Google form. I created 10 open ended question to get the
feedback from non-technical users. I collected 50 feedback from the users. Here is the form.
Here are the 10 questions
1. Was it easy to navigate through the database?
2. Did you find all the required information easily?
3. Was the layout of the database visually appealing?
4. Did you encounter any errors or bugs while using the database?
5. How satisfied were you with the overall performance of the database?
6. Was the database user-friendly?
7. Did you find the database easy to understand?
8. Was it easy to search for information in the database?
9. Were you able to easily find the information you were looking for?
10. Would you recommend this database to someone else?
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
79
lOMoARcPSD|27130093
Making separate conclusion from the feedbacks.
Was it easy to navigate through the database?
Out of 50 responses 36 has gave vote 5. That is mean navigation through the database was
much easy. But looking in the responses I think we need to do some improvement
Did you find all the required information easily?
Majority voted that they found the all required information easily.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
80
lOMoARcPSD|27130093
Was the layout of the database visually appealing?
From this we can see the layout is pretty good but I think we need some improvement of the
layout.
Did you encounter any errors or bugs while using the database?
Lot of people’s dose not face any errors. So, I think it’s better we might check the database
again and do some improvement
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
81
lOMoARcPSD|27130093
How satisfied were you with the overall performance of the database?
lot of peoples are satisfied with the overall performance of the database.
Was the database user-friendly?
I think based on these votes we need to do some work on the interface for improve the
interface.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
82
lOMoARcPSD|27130093
Did you find the database easy to understand?
lot of peoples telling that the database is easy to understand. But I think in this case also we
need to do some improvement.
Was it easy to search for information in the database?
We need to do some improvement for turn it very easy to find the information and search it
better.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
83
lOMoARcPSD|27130093
Were you able to easily find the information you were looking for?
It is very important to be able to find the information you looking for. From this we can decide
our database is easily giving the information they are looking.
Would you recommend this database to someone else?
Majority of peoples are voted that they can recommend the database to someone else. It
means our database is pretty much user friendly and working well.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
84
lOMoARcPSD|27130093
Activity 04
Technical Documentation
Introduction:
The design and execution of the Quiet Attic Films database are described in this technical
documentation. The database was made to satisfy the demands of the movie production firm.
The database design, data relationships, and database structure will all be covered in the
documentation.
Hardware Requirements:





Processor: Dual-core or higher
RAM: 4 GB or higher
Storage: At least 500 MB of free space
Display: 1024 x 768 resolution or higher
Internet connection (for software installation and updates)
Software Requirements:





Operating System: Windows 7/8/10, macOS, or Linux
MySQL database management system
MySQL Workbench (or any other compatible MySQL client)
Python (version 3.6 or higher)
Python MySQL Connector package (for connecting Python with MySQL)
Database Design:
The Quiet Attic Films database has been designed using a relational database model. The
model consists of 6 tables which are Client Details, Production, Staff Details, Location,
Staff Payment, and Property. The tables have been created to store data for the film
production company. The table relationships are as follows:





Client_Details has a one-to-many relationship with Production.
Production has a many-to-many relationship with Location.
Location has a many-to-many relationship with Property.
Production has a many-to-many relationship with Staff_Details.
Staff_Payment has a one-to-many relationship with Staff_Details.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
85
lOMoARcPSD|27130093
Table Schema:
The table schema for the Quiet Attic Films database is as follows:
Client_Details table - This table stores data for clients. The table consists of the following
columns



Client_ID: A unique identifier for each client.
Client_Name: The name of the client.
Phone_Num: The phone number of the client.
Production table - This table stores data for productions. The table consists of the following
columns




Production_ID: A unique identifier for each production.
Production_Type: The type of production.
Days: The number of days the production will take.
Client_ID: The ID of the client for whom the production is being made.
Staff_Details table - This table stores data for staff members. The table consists of the
following columns



STAFF_ID: A unique identifier for each staff member.
NAME: The name of the staff member.
Role_ID: The ID of the role assigned to the staff member.
Location table - This table stores data for locations. The table consists of the following
columns



Location_ID: A unique identifier for each location.
Location_Name: The name of the location.
State: The state in which the location is located.
Staff_Payment table - This table stores data for staff payment. The table consists of the
following columns



Role_ID: A unique identifier for each staff role.
Role: The name of the staff role.
Amount: The payment amount for the staff role.
Property table - This table stores data for properties. The table consists of the following
columns



Property_ID: A unique identifier for each property.
Type: The type of property.
Description: A brief description of the property.
Client_Address table - This table stores data for client addresses. The table consists of the
following columns
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
86
lOMoARcPSD|27130093




Client_ID: The ID of the client for whom the address is being stored.
City: The city in which the client is located.
State: The state in which the client is located.
Country: The country in which the client is located.
Staff_address table - This table stores data for staff addresses. The table consists of the
following columns


STAFF_ID: The ID of the staff member for whom the address is being stored.
Street: The street address of the staff member.
There are three junction tables in this database.
Production_Staff table
This table represents the relationship between the Production and Staff_Details tables, as
multiple productions can have multiple staff members, and each staff member can be assigned
to multiple productions. It includes the following columns.


Production_ID: The unique identifier of the production assigned as an integer.
STAFF_ID: The unique identifier of the staff assigned as a string with a maximum
length of 10 characters.
ProductionLocation table
This table represents the relationship between the Production and Location tables, as multiple
productions can be filmed at multiple locations, and each location can be used for multiple
productions. It includes the following columns.


Production_ID: The unique identifier of the production assigned as an integer.
Location_ID: The unique identifier of the location assigned as a string with a
maximum length of 5 characters.
LocationProperty table
This table represents the relationship between the Location and Property tables, as multiple
properties can be used in multiple locations, and each location can use multiple properties. It
includes the following columns:


Location_ID: The unique identifier of the location assigned as a string with a
maximum length of 5 characters.
Property_ID: The unique identifier of the property assigned as a string with a
maximum length of 7 characters.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
87
lOMoARcPSD|27130093
Use case diagram
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
88
lOMoARcPSD|27130093
Class diagram
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
89
lOMoARcPSD|27130093
DFD Level 0
DFD Level 1
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
90
lOMoARcPSD|27130093
4.2 User Guide
In data base point of view, you can do the basic operation like add data, insert data, view
data like that.
For a client you have basic interface for login.
If you do not have an account, you can create an account.
In user interface you can request for a progress report from the system.
Can check the ongoing projects.
Here are the pictures of that.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
91
lOMoARcPSD|27130093
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
92
lOMoARcPSD|27130093
These are the basic things that client can do.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
93
lOMoARcPSD|27130093
Future enhancements.
1. Integration with other systems : try to integrating the database system with other
systems, such as an inventory management system, to ensure that the inventory levels
( property’s ) in the database are always up-to-date.
2. Task automation : Time can be saved and errors can be decreased by automating
time-consuming operations like data entry or report generation. Think about using
scripts or other automation tools to automate processes.
3. Security measures : Protection from unauthorized access, data breaches, and other
security concerns can be achieved by putting in place security measures including
access limits, encryption, and regular backups.
4. Data analytics: To assist in identifying trends and patterns in sales data, think about
integrating data analytics tools into the system. This can enhance forecasting and
decision-making.
5. Hosting in Cloud platforms: Trying to using the cloud to host the database system,
which enables scalability, cost savings, and simple accessibility from any location
with an internet connection.
Shehan Kavishka
Database Design and Development Assignment 01
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
94
lOMoARcPSD|27130093
Grading Criteria
Achieved Feedback
LO1 Use an appropriate design tool to design a relational
database system for a substantial problem.
P1 Design a relational database system using appropriate
design tools and techniques, containing at least four
interrelated tables, with clear statements of user and system
requirements.
M1 Produce a comprehensive design for a fully-functional
system, which includes interface and output designs, data
validations and data normalization.
D1 Evaluate the effectiveness of the design in relation to user
and system requirements.
Shehan Kavishka
Database Design and Development Assignment 01
95
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
lOMoARcPSD|27130093
LO2 Develop a fully-functional relational database
system, based on an existing system design
P2 Develop the database system with evidence of user
interface, output and data validations, and querying across
multiple tables.
P3 Implement a query language into the relational database
system
.
M2 Implement a fullyfunctional database system, which
includes system security and database maintenance.
M3 Assess whether meaningful data has been extracted
through the use of query tools to produce appropriate
management information
LO3 Test the systems against user and system
requirements
P4 Test the system against user and system requirements.
M4 Assess the effectiveness of the testing, including an
explanation of the choice of test data used.
Shehan Kavishka
Database Design and Development Assignment 01
96
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
lOMoARcPSD|27130093
D2 Evaluate the effectiveness of the database solution in
relation to user and system requirements and suggest
improvements.
LO4 Produce technical and user documentation
P5 Produce technical and user documentation.
M5 Produce technical and user documentation for a fullyfunctional system, including data flow diagrams and
flowcharts, describing how the system works.
D3 Evaluate the database in terms of improvements needed
to ensure the continued effectiveness of the system.
Shehan Kavishka
Database Design and Development Assignment 01
97
Downloaded by Nipuni Chamathka (nipunichamathka60@gmail.com)
Download