Docsity

Database Design and Development (1622) - Assignment 2 ( PASS ), Assignments of Database Management Systems (DBMS)

Toggle sidebar
bg1
Higher Nationals in Computing
Unit 04: Database Design and Development
ASSIGNMENT 2
Learner’s name: NGUYEN GIA HUY
ID: GCS200801
Assessor name: PHAN MINH TAM
Class: GCS0905C
Subject code: 1622
Assignment due: Assignment submitted:
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e

Partial preview of the text

Download Database Design and Development (1622) - Assignment 2 ( PASS ) and more Assignments Database Management Systems (DBMS) in PDF only on Docsity!

Higher Nationals in Computing

Unit 04: Database Design and Development

ASSIGNMENT 2

Learner’s name: NGUYEN GIA HUY

ID: GCS

Assessor name: PHAN MINH TAM

Class: GCS0905C

Subject code: 1622

Assignment due: Assignment submitted:

ASSIGNMENT 2 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 04: Database Design & Development
Submission date Date Received 1st submission
Re-submission Date Date Received 2nd submission
Student Name NGUYEN GIA HUY Student ID GCS
Class GCS0905C Assessor name Phan Minh Tam
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Student’s signature HUY
Grading grid

P2 P3 P4 P5 M2 M3 M4 M5 D2 D

Assignment Brief 2 (RQF)

Higher National Certificate/Diploma in Computing

Student Name/ID Number: NGUYEN GIA HUY/ GCS Unit Number and Title: Unit 04: Database Design & Development Academic Year: 2022 Unit Assessor: Tran Trong Minh Assignment Title: Database implementation and Testing Issue Date: 18 Jan. 22 Submission Date: Internal Verifier Name: Date: Submission Format: Format:

  • This assignment is an Individual assignment and specifically including 2 documents: (1) sql file of your code and represent your code to your tutor (2) a report document
  • You must use font Calibri size 12, set number of the pages and use multiple line spacing at 1.3. Margins must be: left: 1.25 cm; right: 1 cm; top: 1 cm and bottom: 1 cm. The reference follows Harvard referencing system. The recommended word limit is 2.000-2.500 words. You will not be penalized for exceeding the total word limit. The cover page of the report has to be the Assignment front sheet 2. Submission
  • Students are compulsory to submit the assignment in due date and in a way requested by the Tutor.
  • The form of submission will be a soft copy posted on http://cms.greenwich.edu.vn/.
  • Remember to convert the word file into PDF file before the submission on CMS. Note:
  • The individual Assignment must be your own work, and not copied by or from another student.
  • If you use ideas, quotes or data (such as diagrams) from books, journals or other sources, you must reference your sources, using the Harvard style.
  • Make sure that you understand and follow the guidelines to avoid plagiarism. Failure to comply this requirement will result in a failed assignment. Unit Learning Outcomes: 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: Assignment scenario You are employed as a Database Developer for a large IT consultancy company. The company has been approached by FPT Shop which is expanding due to the growth of the number of stores. FPT Shop is currently facing difficulties in dealing with managing the database from all shops on over country. It decided to develop a new database so that: users can register with their phone numbers as IDs and order or rate, comment for their bought devices, shop managers can take care for their stores and director board can view all data from all shops. You are tasked to select one of those systems to develop database for FPT Shop. Your tasks are to:
  • Work with FPT Shop to find out about current requirements for each system
  • Analyse the requirements and produce clear statements of user and system requirements.
  • Design a relational database system using appropriate design tools and techniques
  • Develop a fully functional relational database system, based on an existing system design.
  • Test the system against user and system requirements.
  • Produce technical and user documentation Part 2 (Assignment 2) Once the designs have been accepted by your manager you have been asked to: Develop the database system using evidence of user interface, output and data validations and querying across multiple tables. You want to include more than just the basics so you will implement a fully functional database system which will include system security and database maintenance features. You have decided to implement a query language into the relational database system. The developed system will be demonstrated to your manager. Your manager has asked you to include in the report: (1) Assessing whether meaningful data has been extracted through the use of query tools to produce appropriate management information. (2) Evaluating the effectiveness of the database solution in relation to user and system requirements, and suggest improvements. (3) Once the system has been developed, you will test the system and your manager will complete a witness

Table of Contents

  • across multiple tables. P2. Develop the database system with evidence of user interface, output and data validations, and querying
      1. User interface
      • 1.1. Table diagram
      • 1.2. Graphic User Interface
      1. Querying data
      • 2.1. Select
      • 2.2. Select … where
      • 2.4. Select … group by
      • 2.5. Select group by + having
      • 2.6. Select join
      • 2.7. Sub queries
  • P3. Implement a query language into the relational database system.
      1. Insert data
      1. Update data
      1. Delete data
      1. Create view
      1. Create store procedure
      1. Create triggers
  • P4. Test the system against user and system requirements
      1. Test plan/test case:
      1. Test logs:
  • P5. Produce technical and user documentation:....................................................................................................
      1. System Requirements:
      • 1.1. Hardware Requirements:
      • 1.2. Software Requirements:
      1. Technical Document:
      1. User Document:
  • REFERENCES

P a g e | 1

ASSIGNMENT 2 ANSWERS

P2. Develop the database system with evidence of user interface, output and data validations,
and querying across multiple tables.
1. User interface
1.1. Table diagram
1.2. Graphic User Interface
  • Comment interface design

P a g e | 3

  • Product interfaces design
2. Querying data
2.1. Select
  • In SQL, the SELECT command (which means "get data or query") retrieves a collection of
result records from one or more tables. The most often used command in the data
manipulation language, SELECT, is used to acquire data from one or more tables in the
database.
2.2. Select … where
  • The WHERE clause in SQL Server (T-SQL) is used to filter results from SELECT queries. In
this section of my code, I utilize a lot of (AND, OR) statements to compare statements.

P a g e | 4

2.3. Select … LIKE

P a g e | 6

2.5. Select ... group by + having
  • Similar to the WHERE clause, the HAVING clause in SQL is used to filter data and obtain only
those that fit the criterion or are truly required. The conditional expression WHERE, on the
other hand, delivers the results for each line. The conditional statement HAVING returns the

P a g e | 7

collation results for the GROUP BY clause-created group. We can combine functions like as (SUM,

AVG, MIN, MAX, COUNT). LIKE is a word that has a lot of different meanings.

2.6. Select ... join

P a g e | 9

2.7. Sub queries

P a g e | 10

  • A subquery is a query inside another query in SQL Server. SQL commands can be used to build
queries. The WHERE, FROM, or SELECT clauses include these subqueries. You may also utilize
JOINs with multiple criteria. The subquery is usually found in the WHERE clause. Nested queries or
subqueries are the name for these subqueries. The original subquery will return more quickly than
the INNER JOIN. It's also worth noting that JOINs can't be used to rewrite all subqueries.
P3. Implement a query language into the relational database system.
1. Insert data
  • Insert User
The Enter into [table] values [data] statement is used to insert data into the User
table. With columns such as these ( userID , userName ,UserSex,UserContact,
userAddress ,userEmail, userPassword ). There are numerous limitations, such as the primary key
being userID. And none of the columns are empty. Inserting data into a table is done with the insert
statement
  • Insert Category
The phrase Insert into [table] the value [data] is used to insert data into the Category table. With
columns such as these (categoryID, categoryName). With numerous constraints, such as the main key
being CategoryID and CategoryName being unique. As well as all columns that aren't null. Inserting
data into a table is done with the insert statement. And there are data type limits, such as categoryID
having a maximum of 10 characters and categoryName having a maximum of 50 characters.

P a g e | 12

type constraints such as not exceeding characters such as CommentId only 10,
CommentFeelback only 50, UserId, ProductId is 10. And there are 2 foreign keys associated which are
UserId ,ProductId.
  • Insert Product
This is the operation to insert data for the Product table with the Insert into [table] value [data]
statement. With columns like (ProductId, ProductName , ProductImage, ProductInformation ,
ProductPrice, CatogeryID , ProducerId. With multiple constraints like primary key is ProductId. And all
Non Null columns. The insert statement is used to insert data into a table. And data type constraints
such as not exceeding characters. And data type constraints such as not exceeding characters such as
CommentId only 10, ProductName and ProductImage only 50, UserId, ProductId is 10,
ProductInformation is 100. And there are 2 associated foreign keys that are CatogeryID , ProducerId.

P a g e | 13

2. Update data
  • The UPDATE command in SQL Server is used to update existing records in a SQL Server database
table. The sentences below demonstrate how I changed several columns in my database's tables. I
use the UPDATE command. [update table name] Alter the value of [column to change] to [value to
change]. Where [column to be the condition] = [what is the condition's value].