0% found this document useful (0 votes)
8 views

Lab 1

Uploaded by

asterbelete021
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Lab 1

Uploaded by

asterbelete021
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Lab excrise

Project 1: planning a project and create database


Scenario:

An organization has a library which lends books and audio visual materials for its employees. The organization
has the tradition of keeping library records on MS Excel sheet. But now it is planning to store records in a
database system. The database development project has to be completed in six months.

The library keeps information about books, audio visual materials, and employees who borrows materials. It also
keeps track of who borrows which material at what time. The information on books includes title, author,
category, publisher, and publication year and is identified by ISBN number. Information about audio visual
materials like title, publication year, length in minutes, and storage media type (DVD, CD, or Tape) are recorded
and they are identified by a serial number. The unique number given by the organization, name and sex of
employees are also recorded. When an employee borrows a material, his\her name, the borrowing date, the due
date, and the ISBN number of the book or the serial number of the audio visual material are registered.

Instruction: - under this project, you are expected to perform the following three tasks based on the information
provided.

Task 1: planning and organizing the project. //30 min

Instruction: - under this task, you are expected to prepare a plan for the project using Gantt chart. She/he should
use MS Visio to create the chart. The chart has to show all activities with their time schedule.

Note: the plan must contain at least the following 7 sections.

1. Planning
2. Requirement collection and analysis
3. Design
4. Implementation
5. Data conversion and loading
6. Testing
7. Operation maintenance

Task 2: Create a Database //2 hrs

Instruction: - under this task, you are expected to createa database called Library which contains all the
required tables and relationships. You are expected to use SQL statements to create the tables, constraints, and
relationships.

Task 3: create user interface using MS Visual Studio.NET //2 hrs

Instruction: - under this task you are expected to create a user interface using VB/C# that can be used to enter
data into the Book table and retrieve the entered data.

Project 2: Migrating to New Technology and Using Advanced SQL


Instruction: - In this project you are given a Microsoft access database called ABC_Rental filled with data. You
are expected to migrate to Microsoft SQL Server and write queries on the SQL Server database for the questions
given below. A diagram that shows the relationship between the tables the database is also given.

Information Technology DepartmentPage 1


Lab excrise

Note: you should be provided with a copy of ABC_Rental (the MS-Access database) in order to complete this
project.

Description of the database:

A company has a building with many rooms which are rented for office and business use. The given database of
the company keeps records of rooms, customers who rent room, payments, and rent agreements. The
agreements are renewed annually. The rental payment for a room is based on the size and the payment rate per
square meter. A record is also kept that indicates whether a room is occupied or not. The agreements which are
renewed annually have unique identifier, start date and end date.

Instruction: - Under this project, you are expected to perform the following two tasks based on the information
provided

Task 1: Migrate to New Technology //20 min

Instruction: - under this task you are expected to migrate to the provided Microsoft Access database to
Microsoft SQL Server.

Task 2: Use Advanced SQL // 1:20 hrs

Instruction: - under this task you are expected to write queries that retrieve records from the migrated
(Microsoft SQL Server) database based on the given questions.

1. Write a query that displays room number and total rental income of each room

RoomNo TotalPayement
R001 168096.00
R101 96120.00
R201 72360.00

Information Technology DepartmentPage 2


Lab excrise

R301 42120.00

2. Write a query that shows the room number and price of the room(s) with the rental price

RoomNo Price
R301 2340

3. Write a query that retrieves the last customers name, telephone number, and rental duration(in months)
of unoccupied rooms along with the room number

RoomNo Name Telephone Duration


R301 Feyssa Tulu 0915151515 18

4. Write a query that displays the name and total rental payment of each customer who currently rents a
room.

RoomN TotalPayement Name


o
R201 9045.00 Ahamed Jemal
R101 96120.00 Fatuma Seid
R001 42024.00 Eshome Baysa

Information Technology DepartmentPage 3


Lab excrise

Possible Answer for Task 1: planning and organizing the project using Gantt Chart .

Possible Answer for project 1, Task 2: Create a Database


Create Database Library
Use Library
Create table employee
(
EmpID int identity (1, 1) Not Null Primary Key,
Name varchar(30) Not Null,
Sex Char(1) Not Null,
)

Create Table Book


(
ISBN int identity Not Null Primary key,
Title varchar(50) Not Null,
Author varchar(50) Not Null,
Category varchar(20) Not Null,
Publisher varchar(30) Not Null,
PubYear varchar(4) Not Null,
)
Create table AudioVisual
(
AVID int identity (1, 1) Not Null Primary key,
Title Varchar(50) Not Null,
PubYear varchar(4) Not Null,

Information Technology DepartmentPage 4


Lab excrise

Length int Not Null,


MediaType Varchar(10) Not Null check(MediaType in (‘DVD’, ’ CD’, ’Tape’)),
)

Create Table Circulation


(
CrclID int Identity (1, 1) Not Null Primary key,
EmpID int Not Null,
ISBN int Not Null,
AVID int Not Null,
StartDate DateTime Not Null,
DueDate DateTime Not Null,
Foreign key (EmpID) References Employee (EmpID),
Foreign key (ISBN) References Book (ISBN),
Foreign key (AVID) References AudioVisual(AVID),
)

Possible Answer for Project 2 queries:


1. Select R.RoomNo,Sum(P.Amount) as TotalPayment
From Room R,Customer C, Payments P
Where R.ID=P.RoomNo and C.ID=P.CustID
Group By R.RoomNo

2. Select TOP 1 RoomNo, Area*Rate As Price


From Room
Order By Price

3. Select R.RoomNo, C.Name, C.Telephone, DATEDIFF(mm,Min(pmntStartDate),Max(PmntEndDate)) as


Duration
From payments P, Customer C, Room R
Where R.ID=P.RoomNo and C.ID=P.CustID and P.CustID
IN (Select Max(CustID) as CustID
From Payements P, Room R
Where P.RoomNo=R.ID and IsOccupied=’False’
Group By P.RoomNo)
Group By C.Name,C. Telephone, R.RoomNo

4. Select R.RoomNo, Sum(P. Amount) As TotalPayment, C.Name


From Room R, Payments P, Customer C, Agreements A
Where R.ID=P. RoomNo AND C.ID=P. CustID AND C.ID=A. CustID AND R. IsOccupied=’True’ AND A.
EndDate IN ( Select Max(A. EndDate)
From Agreements A, Room R
Where A. RoomNo=R.ID AND R. IsOccupied=’True’
Group By R. ID )
Group By R. RoomNo, C. Name

Information Technology DepartmentPage 5

You might also like