Docsity

Assignment 2 Database, Essays (university) of Database Programming

Toggle sidebar
bg1
ASSIGNMENT 2 FRONT SHEET
Qualification
TEC 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 TRI TAI
Student ID
GCS200742
Class
Assessor name
NGUYEN VAN SON
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
Grading grid
P2
P3
P4
P5
M2
M3
M4
M5
D2
D3
X
X
X
X
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Assignment 2 Database and more Essays (university) Database Programming in PDF only on Docsity!

ASSIGNMENT 2 FRONT SHEET

Qualification TEC 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 TRI TAI Student ID GCS Class Assessor name NGUYEN VAN SON 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 Grading grid P2 P3 P4 P5 M2 M3 M4 M5 D2 D X X X X

❒ Summative Feedback: ❒ Resubmission Feedback: Grade: Assessor Signature: Date: Signature & Date:

I. INTRODUCE

We choose the school library management system in the previous project to create the first stages for the management system. Continuing from assignment 1, in this assignment 2 we will go into the system together and develop each piece of code to entirely fill up the system's data. II. DEVELOP THE DATABASE SYSTEM

  1. Evidence of user interface
  • I utilize SQL 2019 to create the database for the UoG school's library management system.
  1. Create Database, Tables 2.1. Student Database of Student Table of Student This table used to store information of Library’s student information, student’s id, student’s name, student’s class, student’s gender, student’s email, student’s phone, student’s address. This table have primary key is Student_id.

2.3. Loan Card Database of Loan card Table of Loan card This table used to store information of Library’s Loan Card information, loan card’s id, Student’s id, Staff’s id, Loan term. This table have primary key is Loan_card_id. Foreign key is Student_id and Staff_id.

2.4. Book Database of Book Table of Book This table used to store information of Library’s Book information, Book’s id, Book’s author, Book’s Category, Book’s name, Book’s year of manufacture. This table have primary key is Book_id

  1. Diagram of Library
  • This is the official diagram for the library management system of the University of Greenwich
  • Each diagram tells us what data they store in it.

III. IMPLEMENT A QUERRY LANGUAGE INTO THE RELATIONAL DATABASE SYSTEM

  1. Insert:
  • Data of student’s table:

Insert into Student (student’s id, student’s name, student’s class, student’s gender, student’s email, student’s phone, student’s address) values (‘GCS2007’, ‘NguyenVanA’, ‘GCS0903B’, ‘Male’, ‘[email protected]’, ‘0903003003’, ‘GoVap’) Insert into Student (student’s id, student’s name, student’s class, student’s gender, student’s email, student’s phone, student’s address) values (‘GCS2007’, ‘NguyenVanB’, ‘GCS0903B’, ‘Male’, ‘[email protected]’, ‘09030 03004 ’, ‘TanBinh’) As a consequence, all of the information in the table will be filled in about data of student.

  • Data of staff

Insert into Staff (staff’s id, staff’s name, staff’s email, staff’s phone, staff’s address) values (‘GES2001’, ‘NguyenThiC’, ‘[email protected]’, ‘0903003005’, ‘District6’) Insert into Staff (staff’s id, staff’s name, staff’s email, staff’s phone, staff’s address) values (‘GES2002’, ‘NguyenThiD’, ‘[email protected]’, ‘0903003006’, ‘BinhThanh’) As a consequence, all of the information in the table will be filled in about data of staff

  • Data of Loan card

Insert into Loan_Card (Loan_card_id, Student_id, Staff_id, Loan_term) Values (‘ 123 ’, ‘GCS2007’, ‘GES123’, ‘10days’) Insert into Loan_Card (Loan_card_id, Student_id, Staff_id, Loan_term) Values (‘234’, ‘GCS200701’, ‘GES124’, ‘10days’)

  • Data of staff The information we supply to the staff table will be used to update the data.
  • Data of Loan_card The information we supply to the loan_card table will be used to update the data.
  • Data of book The information we supply to the book table will be used to update the data.
  • Data of borrow info The information we supply to the borrow info table will be used to update the data.
  1. Delete
  • Delete statement will have the following syntax: DELETE FROM Table WHERE condition; So we will have the statement of DELETE in table student: And it will result in the DELETION of the information we enter at the email address: [email protected]
  1. Select
  • Select statement will have the following syntax: SELECT “expression” FROM “table” [WHERE “condition”]; So we will have the statement of SELECT in table student: And it will result in the SELECTION of student we enter at the student’s phone is 0903003003
  1. Test case 2 With the delete statement, we have the following results: We can see that we have no rows affected because we don't have the correct data, so this statement can't execute.