Explain the main concepts for data modelling

Assignment Help PL-SQL Programming
Reference no: EM132660007

ISYS3412 Practical Database Concepts - RMIT University

Assessment: Database Design Project

Overview
The objective of this assignment is to reinforce what you have learnt in the lectures and tute/lab sessions throughout the course. Specifically, it covers the advanced concepts in relational database design, using SQL for querying a relational database and building a simple application that connects to a database backend running a simple relational schema.

Assessment Criteria
This assessment will measure your ability to:
• Use normalisation process to evaluate the schema and make sure that all of the relations are at least 3NF.
• Create tables on SQLite Studio and populate them with data available from the sources outlined above.
• Write SQL statements required for CRUD (create, read, update and delete) operations on the database you built;
• Appreciate a good database design;
• Apply good database design guidelines, such as normalisation, to build a well-designed database schema;
• Write efficient SQL statements for retrieving data for specific user requirements;

Learning Outcome 1: explain the main concepts for data modelling and characteristics of database systems;
Learning Outcome 2: develop a sound database design using conceptual modelling mechanisms such as entity-relationship diagrams;
Learning Outcome 3: develop a database based on a sound database design;
Learning Outcome 4: Apply SQL as a programming language to define database schemas, update database contents and to extract data from databases for specific users' information needs.

Part A Relational Database Design
After analyzing the requirements of the University Enrollment Management System outlined in Assignment 1, you have come up with the following ER UML model:

The clients have indicated that the design needs to manage details about lab assistants that are also involved in courses, but that there are no other types of students. This model was incorrectly mapped into the following set of relations:
Staff(staffID, name) Qualification(name, year) Holds(staffID*, name*, year*) Tutor(staffID*, name)
Lecturer(staffID*, name, year, semester) Tutors(year*, semester*, staffID*) CourseOffering(year, semester)
Course(courseID, name, creditPoints, fee, prerequisuites*) Offers(courseID*, year*, semester*)
Student(studentID, name, DOB, gender) Enrolment(grade, status) Local(StudentID*, TFN, hecAmount) International(StudentID, visa)

1. Identify any missing relations and their attributes, denoting their primary and foreign keys.
2. For the complete set of relations (including the newly added relations), write down all functional dependencies. If there are no functional dependencies among attributes, you must state so. Do not write down trivial functional dependencies, such as staffID ? staffID.
3. Write down the highest normal form that each of these relations is in. For each of these relations, state the reasons why it doesn't meet the next normal form requirements. This is not required if the relation is in 3NF. Identify any redundant relations (explaining why they are redundant).
4. If they are not in 3NF, decompose them into 3NF relations.
Write down the full database schema at the end of this step, eliminating decomposed relations and replacing them with newly created relations.
5. Where possible, combine the relations resulting from Part 3.
6. Write down the full database schema at the end of this step, eliminating combined relations and replacing them with newly created relations. Remove any relations that you have identified as redundant or unnecessary.
7. Write down the final relational database schema.

Part B SQL

LibraryDB is a database system that keeps track of information concerning the books and their circulation in an imaginary library.

Disclaimer: The data that populates the database are artificially constructed and by no means correspond to actual real-world data.

The schema for the LibraryDB database is given below.

borrow(transactionID, personID*, borrowdate, duedate, returndate)
author(authorID, firstname, middlename, lastname)
book_copy(bookID, bookdescID*)
book(bookdescID, title, subtitle, edition, voltitle, volnumber,
language, place, year, isbn, dewey, subjectID*)
borrow_copy(transactionID*, bookID*)
person(personID, firstname, middlename, lastname, address, city,
postcode, phonenumber, emailaddress, studentno, idcardno)
publisher(publisherID, publisherfullname)
written_by(bookdescID*, authorID*, role)
published_by(bookdescID*, publisherID*, role)
subject(subjectID, subjecttype)

Write SQL queries for the following tasks:

1. Display the firstname and lastname of authors that have written books (not translated) where one of the publishers (not editors) is 'Prentice-hall' (include books that are co-published with other publishers).
a. Write your query using an EXISTS sub query.
b. Write your query using a JOIN

2. List the firstname and lastname of every author who has ever translated a book. Each authors' role in writing of the book is described in "role" attribute in the written_by table.

3. Display the title of books that have no copies in the library.
a. Write the query using a IN/NOT IN
b. Write the query again using an OUTER JOIN
c. Write the query again using SET operators

4. Books sometimes have more than one publisher. Display the names of publishers that have worked together on the same book in any capacity (as publisher or editor) identifying which publisher they worked with. Order the results in alphabetical order of the first publisher's name, then the second publisher's name. There must be no rows that duplicate the same information. eg the fact that Prentice-hall and Microsoft Press published together should not appear more than once (in any combination).

5. List the firstname and lastname of authors that have written (not edited) books with "engineering" occurring anywhere in the title.

6. List the title of books that have only ever been borrowed by students. ie they have the ‘student' classification in the person table.

7. The library wants to make auto recommendations based on members past borrowing history. As a test case, display the list of books that are on the same subjects as books previously borrowed by member "John Johnston".

8. Display the firstname and lastname of the library member(s) that has/have borrowed the most number of books. If there is more than one member, show them all. Your query should show the number of books along with the member's name.

Provide detailed answers to the following question.
9. The current design only allows each book to have one subject which is not very realistic. Provide the required changes to the database schema to accommodate this requirement.
Your answer should include a portion of the ER model where the changes are applied and the updated relational database schema. If required, you may add new relations and attributes and also new foreign keys.

10. The current design has a lot of null values when modelling relationships and has no use of inheritance to model commonality.
Provide the required changes to the database schema to accommodate this requirement.
Your answer should include a portion of the ER model where the changes are applied and the updated relational database schema. If required, you may add new relations and attributes and also new foreign keys.

Part C Relational Database Design
Consider the following schema for an auction database site:
Auction(buyerUsername, buyerAddress, bidNo, bidAmount, bidDate, bidTime, itemID, itemStartDate, itemEndDate, itemCategoryTitle, itemSubCategoryTitle, sellerUsername, sellerAddress, sellerBusinessNo, sellerBusinessAddress)

1. Identify the functional dependencies of the Schema.

2. Decompose the relation into 3NF. Where possible combine relations, but avoid introducing NULL values wherever possible. Identify the final relational database schema identifying primary keys and foreign keys. Avoid introducing unnecessary attributes and keys.

3. Create an ER UML diagram representing your decomposed design.

4. The organization wants the successful buyer (who wins the Auction) to be able to leave feedback (a rating and a comment) on the item that they purchased. Show how this can be supported by updating your ER UML diagram. Identify any limitations of your design.

5. Produce a set of SQL statements to create your tables in SQLite and populate with the above data. (do not include the changes outlined in step 4).

6. Write a query that will join your tables together to reproduce the information in the above table (in the same order).

7. Write a query to identify the username of the winner of each auction item and the amount of the winning bid (any auction item that is not bid on should have 'NONE' listed as the winner's username and 0 of the amount of the winning bid). Your query result must be based on the date and time that the query is executed.

8. New bids must be greater than the current highest bid, and bidno must be ONE more than the last successful bid, and the bid date cannot be after the items end date. Use trigger(s) to enforce these rules.

Attachment:- Practical Database Concepts.rar

Reference no: EM132660007

Questions Cloud

Prepare the adjusting journal entry for rose ltd : Use a current tax worksheet to calculate the current tax liability for the year ended 30 June 2020. Prepare the adjusting journal entry.
Prepare a statement of cash flows from investing activities : Prepare a statement of cash flows from Investing activities. Payments for electricity, telephone, rent and insurance. 5,000. Drawings 50 000
What are the available amount of the exclusion gain : Can Pedro use the § 121 exclusion if he and Maria file a joint return? If so, what are the available amount of the exclusion and the recognized gain
How much of gillian wages for the week should be charged : During the first week of April, Gillian worked a total of 50 hours, How much of Gillian's wages for the week should be charged to direct labour?
Explain the main concepts for data modelling : Develop a sound database design using conceptual modelling mechanisms such as entity-relationship diagrams and explain the main concepts for data modelling
What was the net income in thousands for the year : What was the net income (in thousands of $) for the year? The following data (in thousands of dollars) have been taken from the accounting records of Karling Co
Determine what was the cost of goods sold for the year : Karling Corporation for the year just ended. Purchases of raw materials $120. What was the cost of goods sold (in thousands of $) for the year?
What do you think is needed for hispanic groups : What do you think is needed for Hispanic/Latino groups to assimilate and be accepted by mainstream society? Is this necessary? Why does it appear that Americans
Find what was the cost of goods manufactured for year : Work-in-process inventory, beginning $ 70. What was the cost of goods manufactured (finished) for the year (in thousands of $)?

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd