Anda di halaman 1dari 4

DISC 112: Assignment 7

Lab section 2 (02:30 pm 05:20 pm)


Roll no.: _______________________ Date: 9 March 2017
This assignment can be completed in groups but must be submitted individually.
From each group, one assignment would be marked and the marks obtained in marked assignment
would be assigned to all group members.
The assignment is divided into three parts.
The total marks for the assignment are 25.

Preliminary task:

1. Open a blank excel workbook and save it in D drive. Name the excel workbook after your roll number (e.g.
2011001).

2. Create a new worksheet and name it Group Details. Provide the information regarding your name,
roll number, group number and roll numbers of your group members in the newly created worksheet:

The filled cells of the worksheet should look like the following:

There are no marks allocated to the preliminary task. However, if the preliminary task is not done
correctly there will a penalty of 5 marks from the assignment total marks.

Assignment instructions:

You will need access database file Books for completing Part A and Part B of the assignment.
Save the downloaded file in D Drive before you proceed.
Description of the database:

The database stores information regarding authors, books, publishers and jobs of employees at
publishers in 5 tables which are joined by 5 relationships (see the entity relationship diagram below).

Entity Relationship Diagram:

A
B

The description of each relationship is given below:

Relationshi
Relationship Description
p
A 1 author can write 1 to many books
B 1 book can have 1 to many authors
C 1 publisher can publish 1 to many books
D 1 publisher can have 1 to many employees
E 1 job can exist for 1 to many employees

In the first two parts of the assignment, you will be required to import data from database into excel based
on the relationships defined in the relationship diagram above.
In the third part of the assignment, you will be required to import data from multiple sources into excel
workbook.
Part A (10 marks)
1. Insert an empty worksheet and name it Sci-Fi-&-Action Female Authors. (1)
2. Import information in worksheet created in step 1 from the access database Books such that the following
attributes appear for science fiction and action books written by female authors;
o author ID
o author last name
o author first name
o author subject
o title ID of the book
o title of the book
o books publisher ID
o price of book and
o name of publisher of the book. (4)
Note:
- You must import information as excel table.
- The three database tables that must be referred in your query includes; Authors, BookAuthor and
Books.
- The fields for gender of author and subject should not appear in the excel table. You will need to edit the
query after importing the data.
- Refer to the image below for the expected output in worksheet.
3. Rename the table as SFA-F. (1)
4. Create a copy of the worksheet and rename it as Sci-Fi-&-Action Male Authors. (1)
5. Display the same fields as imported in step 2 above for only male authors by editing the query in the
connection properties (Hint: Edit au_gender field in WHERE part of your query.) (2)
6. Rename the table as SFA-M. (1)
Sample outputs:
Part B (7 marks)
1. Insert an empty worksheet and name it Publishers. (0.5)
2. Import information (as excel table) in the worksheet created in step 1 from access database Books that
follows the following SQL query: (5.5)

SELECT Publishers.pub_id, Publishers.pub_name, Employees.job_id, Employees.job_lvl, Jobs.job_desc


FROM Employees Employees, Jobs Jobs, Publishers Publishers
WHERE Employees.job_id = Jobs.job_id AND Employees.pub_id = Publishers.pub_id AND
((Publishers.country = France))
ORDER BY Publishers.pub_name DESC
3. Change the option which enables refreshing of data every time the excel file is opened. (1)

After completing part B, the top 12 rows of the worksheet must appear as follows:

Part C (8 marks)
You will need two text files, grade cutoffs.txt and grades.txt for completing this part of assignment.
Download the text files from Assignment 7 tab and save them in the D Drive.
1. Insert a new worksheet and name it Grade Cutoffs. (0.5)
2. Import the downloaded text file grade cutoffs.txt in the worksheet created in step 1. (1)
3. Convert the data range in a table and name it Cutoffs. (1)
4. Create a new worksheet and name it Student Grades. (0.5)
5. Import the downloaded text file grades.txt in the worksheet created in step 4. (2)
6. A) Add a new attribute for grades in column C of worksheet created in step 4. Name it GPA.
B) Extract the GPA for each student from the data imported in Grade Cutoffs worksheet. (3)

Anda mungkin juga menyukai