Question

DATABASES You are required to design and implement a relational database to help the local community...

DATABASES

You are required to design and implement a relational database to help the local community center better serve the residents in your neighborhood.

Database Specifications:

In your preliminary analysis, you have determined the following basic facts about the community center and the services it provides to the residents in the neighborhood: - The community center serves multiple areas which fall into different zip codes. 

- The community center provides collaborative family based care services. An immediate family is defined to include one or both parents and any of their children living at the same or different address.

- Each family resides at an address or addresses. An address includes an apartment or floor number (or none), street number, street name, borough or city name, and zip code.

- The community center engages in activities related to the services it provides. Possible services are: [a] Health services [b] Education and learning [c] Gender related services [d] Water and sanitation [e] Child protection [f] Nutrition [g] Others.

- Residents volunteer to help in the activities which target various groups of residents. Possible groups are: [a] The community at large/collective benefit [b] Women [c] Youth [d] Children [e] Senior citizens [f] Minorities [g] Underprivileged/disadvantaged [h] Disabled and handicapped [i] Others.

-The community center carries out projects related to the services it provides, which aim to benefit some of the groups in its area.

- A project is specific to one or more activities. The characteristics of a project include a unique ID, title, starting date, and duration.

- Local and/or regional donors of various types (individuals, organizations, charities, government, etc.) provide funds for the projects. Funds encompass, but are not limited to cash, training, and/or equipment, each of monetary value.

Assignment [I]

1) Explore at least five sites of family based community services on the Web to verify the basic facts and collect additional information. Provide in the introduction of the project report the URLs of the sites explored and the additional information and/or requirements you gathered.

2) Draw an appropriate E/R diagram that satisfies the basic and additional facts, indicating, weak and subclass entity sets, whenever exist, multiplicity of relationships, and the key, or keys, for each entity set. Distinguish between the parts of the E/R diagram pertaining to the given and extra basic facts.

3) Translate the E/R diagram in [2] to relational database schemas.

4) Specify a number of essential functional dependencies for each relation. Identify possible keys, whenever exist, and the primary key and foreign keys for each relation.

5) Examine the database relations for BCNF and 3NF violations. Decompose the relations as necessary to resolve any anomalies that may be found the data.

II) Create SQL expressions to answer the following queries. You may need to modify the database schema to answer the queries given.

1) Identify all members of a given family. Display the family members’ names, addresses, and relationships.

2) Identify all family members of a given family who volunteered to a certain activity.

3) Identify all family members of a given family who benefited from a certain project

4) Identify the total amount of money donated by the members of a given family and the projects the money was donated to.

5) In view of the information in the database, establish a criterion based on which the community center could identify residents for assistance with one of its services/activities/projects.

6) Any other queries you deem important.

III) Submit a written report that includes:

1) Introduction that presents an overview of the problem and solution approach.

2) The complete E/R diagram and schema of the relational database fully specifying the given requirements and any other requirements gathered. Identify all keys, foreign keys, functional dependencies of the database relations.

3) SQL code that creates the tables’ structure.

4) SQL code that loads the data. Data must be representative of fair size.

5) SQL code that answer the given queries.

6) Sample outputs for your SQL code.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

import java.util.Scanner;
/* Class BTNode */
class BTNode
{
BTNode left, right;
int information;
/* Constructor */
open BTNode()
{
left = invalid;
right = invalid;
information = 0;
}
/* Constructor */
open BTNode(int n)
{
left = invalid;
right = invalid;
information = n;
}
/* Function to set left hub */
open void setLeft(BTNode n)
{
left = n;
}
/* Function to set right hub */
open void setRight(BTNode n)
{
right = n;
}
/* Function to get left hub */
open BTNode getLeft()
{
return left;
}
/* Function to get right hub */
open BTNode getRight()
{
return right;
}
/* Function to set information to hub */
open void setData(int d)
{
information = d;
}
/* Function to get information from hub */
open int getData()
{
return information;
}
}
/* Class BT */
class BT
{
private BTNode root;
/* Constructor */
open BT()
{
root = invalid;
}
/* Function to check if tree is unfilled */
open boolean isEmpty()
{
return root == invalid;
}
/* Functions to embed information */
open void insert(int information)
{
root = insert(root, information);
}
/* Function to embed information recursively */
private BTNode insert(BTNode hub, int information)
{
in the event that (hub == invalid)
hub = new BTNode(data);
else
{
in the event that (node.getRight() == invalid)
node.right = insert(node.right, information);
else
node.left = insert(node.left, information);
}
return hub;
}
/* Function to check number of hubs */
open int countNodes()
{
return countNodes(root);
}
/* Function to check number of hubs recursively */
private int countNodes(BTNode r)
{
in the event that (r == invalid)
return 0;
else
{
int l = 1;
l += countNodes(r.getLeft());
l += countNodes(r.getRight());
return l;
}
}
/* Function to scan for a component */
open boolean search(int val)
{
return search(root, val);
}
/* Function to scan for a component recursively */
private boolean search(BTNode r, int val)
{
on the off chance that (r.getData() == val)
return genuine;
on the off chance that (r.getLeft() != invalid)
on the off chance that (search(r.getLeft(), val))
return genuine;
on the off chance that (r.getRight() != invalid)
on the off chance that (search(r.getRight(), val))
return genuine;
return false;
}
/* Function for inorder traversal */
open void inorder()
{
inorder(root);
}
private void inorder(BTNode r)
{
on the off chance that (r != invalid)
{
inorder(r.getLeft());
System.out.print(r.getData() +" ");
inorder(r.getRight());
}
}
/* Function for preorder traversal */
open void preorder()
{
preorder(root);
}
private void preorder(BTNode r)
{
on the off chance that (r != invalid)
{
System.out.print(r.getData() +" ");
preorder(r.getLeft());
preorder(r.getRight());
}
}
/* Function for postorder traversal */
open void postorder()
{
postorder(root);
}
private void postorder(BTNode r)
{
in the event that (r != invalid)
{
postorder(r.getLeft());
postorder(r.getRight());
System.out.print(r.getData() +" ");
}
}
}
/* Class BinaryTree */
open class BinaryTree
{
open static void main(String[] args)
{
Scanner filter = new Scanner(System.in);
/* Creating object of BT */
Bt = new BT();
/* Perform tree operations */
System.out.println("Binary Tree Test\n");
singe ch;
do
{
System.out.println("\nBinary Tree Operations\n");
System.out.println("1. embed ");
System.out.println("2. seek");
System.out.println("3. number hubs");
System.out.println("4. check discharge");
int decision = scan.nextInt();
switch (decision)
{
case 1 :
System.out.println("Enter whole number component to embed");
bt.insert( scan.nextInt() );
break;
case 2 :
System.out.println("Enter whole number component to seek");
System.out.println("Search result : "+ bt.search( scan.nextInt() ));
break;
case 3 :
System.out.println("Nodes = "+ bt.countNodes());
break;
case 4 :
System.out.println("Empty status = "+ bt.isEmpty());
break;
default :
System.out.println("Wrong Entry \n ");
break;
}
/* Display tree */
System.out.print("\nPost arrange : ");
bt.postorder();
System.out.print("\nPre arrange : ");
bt.preorder();
System.out.print("\nIn arrange : ");
bt.inorder();
System.out.println("\n\nDo you need to proceed with (Type y or n) \n");
ch = scan.next().charAt(0);
} while (ch == 'Y'|| ch == 'y');
}
}

Add a comment
Know the answer?
Add Answer to:
DATABASES You are required to design and implement a relational database to help the local community...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The relational schema shown below is part of a student database. The primary and foreign keys are highlighted in bold.

    The relational schema shown below is part of a student database. The primary and foreign keys are highlighted in bold.Student (studNo, studName, address, mobileNo)Course (courseNo, courseName, creditHour, level) Registration (studNo, courseNo, regDate, semester, session)Project (projNo, projName, courseNo)Assignment (projNo, studNo, startDate, dueDate, hoursSpent)Write SQL queries based on the student database given above: 1. Create tables & constraints for the student database.2. Insert some data into the tables to check that the tables created are correct. No limit on how many rows you want...

  • **************PLEASE COMPLETE PART E) ONLY************** Consider the following relational database schema (primary keys are underlined) and...

    **************PLEASE COMPLETE PART E) ONLY************** Consider the following relational database schema (primary keys are underlined) and SQL query: Hotel (hotelNo, hotelName, city) Room (roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest (guestNo, guestName, guestAddress) SELECT g.guestNo, g.guestName FROM Room r, Booking b, Hotel h, Guest g WHERE h.hotelNo = b.hotelNo AND g.guestNo = b.guestNo AND h.hotelNo = r.hotelNo AND h.hotelName = "Ritz" AND dateFrom >= "Jan 01, 2001" AND dateTo <= "Dec 31, 2001"; (A) state what...

  • **************PLEASE COMPLETE PART F) ONLY************** Consider the following relational database schema (primary keys are underlined) and...

    **************PLEASE COMPLETE PART F) ONLY************** Consider the following relational database schema (primary keys are underlined) and SQL query: Hotel (hotelNo, hotelName, city) Room (roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest (guestNo, guestName, guestAddress) SELECT g.guestNo, g.guestName FROM Room r, Booking b, Hotel h, Guest g WHERE h.hotelNo = b.hotelNo AND g.guestNo = b.guestNo AND h.hotelNo = r.hotelNo AND h.hotelName = "Ritz" AND dateFrom >= "Jan 01, 2001" AND dateTo <= "Dec 31, 2001"; (A) state what...

  • Project: Relational Modeling Note: This project must be unique in its design (E-R diagram) and implementation...

    Project: Relational Modeling Note: This project must be unique in its design (E-R diagram) and implementation (SQL queries). You are not to copy or use any part of a database project that was previously submitted or appears on the Web, in a textbook, or otherwise made available via an external source. Contact your instructor if you have any questions regarding this requirement. Deliverables for Part 1: (1) Project Description. Provide an overview of your project identifying the major components as...

  • Project Description In this project, you will design and implement a database for keeping track of...

    Project Description In this project, you will design and implement a database for keeping track of information for an online “SOCIAL NETWORK” system (e.g. a simplified version of Facebook!). You will first design an EER schema diagram for this database application. Then, you will map the EER schema into a relational database schema and implement it on ORACLE or MySQL or some other relational DBMS. Finally, you will load some data into your database (via user Interface) and create some...

  • Consider the relational database schema for a company below. EMPLOYEE/NAME, SSN, BDATE, ADDRESS, SEX, SALARY, SUPERSSN,...

    Consider the relational database schema for a company below. EMPLOYEE/NAME, SSN, BDATE, ADDRESS, SEX, SALARY, SUPERSSN, DNA) TA DEPARTMENT(DNAME, DNUMBER. MESSINS, MGRSTARTDATE) DEPT_LOCATIONS(DNUMBER. DLOCATION PROJECT(PNAME, PNUMBER. PLOCATION, DNLIM) WORKS_ONCESSN.PNG, HOURS) DEPENDENTESSN, DEPENDENT-NAME, SEX, BDATE, RELATIONSHIP) Write SQL statements for the following queries: a) List the names of those employees who work in the "Production" department (6 marks). b) Find the maximum salary, minimum salary, and the average salary among employees who work for the "Production department (6 marks). Count the...

  • database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED...

    database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED BELOW CREATE TABLE Department ( DECIMAL(5) VARCHAR(30) CHAR(5) DATE NOT NULL NOT NULL NOT NULL * Department number /*Department name * Department manager number */ /Manager start date DNumber DName Manager MSDate CONSTRAINT Department_PK PRIMARY KEY(DNumber) CONSTRAINT Department_CK UNIQUE(DName) CREATE TABLE DeptLocation DECIMAL(5) VARCHAR(50) NOT NULL NOT NULL DNumber * Department number */ * Department location */ Address CONSTRAINT DeptLocation_PK PRIMARY KEY(DNumber, Address) CONSTRAINT...

  • DATABASE SYSTEMS Project INDIVIDUAL WORK DELIVERABLE #: SUBMISSION DATE No Group Work Allowed Apr...

    DATABASE SYSTEMS Project INDIVIDUAL WORK DELIVERABLE #: SUBMISSION DATE No Group Work Allowed April 8 Introduction to Coursework You have been approached by a University for the design and implementation of a relational database system that will provide information on the courses it offers, the academic departments that run the courses, the academic staff and the enrolled students. The system will be used mainly by the students and the academic staff. The requirement collection and analysis phase of the database...

  • Relational Database Design Theory, please answers ALL parts because they are related to each other, and I can't separate it into different questions. Please help! By looking at the PHLogger tab...

    Relational Database Design Theory, please answers ALL parts because they are related to each other, and I can't separate it into different questions. Please help! By looking at the PHLogger table: A. List all non-trivial functional dependencies. B. What is the highest normal form the PHLogger table is in currently? C. The external consulting experts at DBInstructor, Inc., have noticed that city and state of an address can be inferred by its postal code (zip code). What new functional dependencies...

  • Develop SQL code that would create the database files corresponding to your relational schema for the...

    Develop SQL code that would create the database files corresponding to your relational schema for the Mountain View Community Hospital case study created in Phase 2 of the class project. Write the SQL statements for creating the tables, specifying data types and field lengths, establishing primary keys and foreign keys, and implementing other constraints you identified. Write the SQL statements that create the indexes. This is optional. You should execute your SQL code on a DBMS (Oracle 11g or Oracle...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT