DB and Recovery Project Two
DB and Recovery Project Two
Faculty of Technology
Information Commination Technology
Web Development and Database Administration
Level – III
Occupational Standard (OS)
Unit of Competence: Complete Database Backup and Recovery
Project Two
Exercise one using SQL
Assume you are working in Harambe Library in database administrator. Harambe Library has Book,
Student and Borrow Books.
Book Identified by Book_ID (PK), Title, Author, Quantity and Publication date.
Student Identified by Student_Id (Pk), Student_Fname, Student_Lname, Sex and Department.
Borrow Books Identified by BorrowID (PK), Book_ID (FK), Student_ID (FK) and Borrow Date.
1. Draw ERD diagram based on the above information Use micro software Visio 2007.
2. Create a database called Harambe Library.
3. Create the following tables in Harambe library database.
Book
Book_ID(PK) Title Author Quantity Publication date
Student
Student_Id(Pk) Student_Fname Student_Lname Sex Department
Borrow Books
BorrowID(PK) Book_ID(FK) Student_ID(FK) BorrowDate
4. Assign appropriate data type, field size, field name, constraints (primary key and foreign
key), relationship for each table and fields.
Book
Book_ID Title Author Quantity Publication date
B001 Database Mikle m.k 10 1999
B002 Introduction to Network Melick 7 1968
B003 Accounting Shwang 5 2007
B005 Introduction to management Michiga 10 2010
B006 Introduction to Economics Robert 9 2001
Student
Borrow Books
BorrowID Book_ID Student_ID BorrowDate
001 B001 S008 1/1/2009
002 B002 S006 2/2/2009
003 B001 S002 1/1/2009
004 B002 S001 1/1/2009
005 B005 S004 2/2/2009
006 B006 S005 1/1/2009
007 B003 S007 1/1/2009
008 B003 S003 2/2/2009
A. Display all record from student table and order by their last name.
B. Display all record from book table.
C. Display male student record.
D. Display only book title and book Author from book table and order by book title in ascending order.
E. Display only student first name and last name from IT department.
F. Add 5 quantity of accounting book on the original value.
G. Change Alem behailu last name into Alem Abebe.
H. Change behailu Adugna department into Accounting.
I. Change zelalem Belay sex into M.
J. Delete Book record who’s their quantity is less than 1.
K. Delete Hirut habtamu record from student table.
L. Select top 5 records in student table.
M. Select top 2 Record from book table.
N. Select student name that starts with A letter.
O. Select all student record their department is end letter with t.
P. Display all student record Accounting and IT department.
Q. Display all book record their quantity is between 10 and 7.
R. Display the sum of quantity of book by the name of Total quantity.
S. Display the minimum value of quantity as least quantity.
T. Display the maximum value of quantity as heist quantity.
U. Display Student name that borrows Accounting book.
V. Display student name that borrows introduction to networking book.
W. Import and Export your Harambee Library database
X. Backup your database on D drives and gives backup name library backup.bak using sql command.
Y. Delete your database using sql statement.
Z. Restore your database from your backup.