Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

Hired by the City of Metropolis to design a database for the Metropolis Transit Authority (META), which runs the city's subway system. The system consists of a number of subway stations, each with a name, and a number of subway lines that connect various stations. Each line runs in two directions, called uptown and downtown. Of course, every day there are many trains on each line. For simplicity, assume that each train has some time when it departs from the first station, and that if the following train starts say 6 minutes later, it will arrive 6 minutes later than the previous train on every station that is on this line. Thus, to store the schedule, you only have to store the starting time of each train, and the times in takes between the stations on the line (which is the same for all trains.)

Customers have to purchase a transit card called METACard to use the subway, and the card can be refilled with credits as needed. Assume that customers have to swipe this card whenever they enter or exit a station, and that the system then deducts from their card the cost of the trip, which depends on where they enter and leave the subway. For example, a trip from "Luthor Avenue" to "Lois Lane" might cost $2, while a trip from "Metro Square" to "Park Avenue" costs $2.50. So the price might be different between any two stations. METACards are identified by an ID, but do not have a customer name associated with them since they can be bought at any newsstand without giving a name. The balance for each card has to be maintained in your database, so that the actual card only stores an ID that is read and transmitted to the database system when the card is swiped.

a) Design an ER diagram that can model the above scenario. Identify any weak entities, suitable keys, and the cardinalities of the relationships. Discuss any assumptions that you are making in your design.

b) Write statements in SQL for the following queries. Note that if your schema does not allow you to answer a query, you may have to go back and change your design.

1. List the names of station where the train departed within the last hour.

2. Assuming that there is a direct train going from "Metro Square" to "Broadway", output the travel time and cost of the trip.

3. For each subway station, output how many people swipe in and out between 8pm and 10pm on Feb 16.

4. Check if there is a way to go from "Metro Square" to "Lois Lane" by changing at most once.

5. Output the customer who took the train from same station at least twice on the same day.

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M92738768

Have any Question?


Related Questions in DBMS

Backgrounda new training organization called abc

Background A new training organization called ABC TechTraining is opening soon and they have approached you to help design their new database. They have just completed the refurbishment of the premises and are now lookin ...

Objectivethe objective of this lab is to be familiar with a

OBJECTIVE: The objective of this lab is to be familiar with a process in big data modeling. You're required to produce three big data models using the MS PowerPoint software. This tool is available on UMUC Virtual Deskto ...

Project outline and requirements provide a brief

Project Outline and Requirements Provide a brief description of the organization (can be hypothetical) that will be used as the basis for the projects in the course. Include company size, location(s), and other pertinent ...

Sql injection on a searchthe way search performs its task

SQL injection on a search The way Search performs its task is by executing the following query (in a php script):          $var=stripslashes($_POST['search']);          $query = "SELECT username from lab1_login where use ...

A schools office of the registrar maintains data about the

A School's office of the registrar maintains data about the following entities: a) courses (including course number, title, credits, syllabus and prerequisites), b) course offerings (including course number, year, semest ...

Question find at least two academic sources that describe

Question: Find at least two academic sources that describe the movement of Enterprise resource planning (ERP) activities to the cloud. Discuss the types of ERP activities that can be conducted in the cloud and the pros a ...

Sql transactions exercisesconsider table itemnameprice

SQL Transactions Exercises Consider table Item(name,price) where name is a key, and the following two concurrent transactions. T1: Begin Transaction; Update Item Set price = 2*price Where name = 'pencil'; Insert Into Ite ...

Database and information retrieval assignment - data

Database and Information Retrieval Assignment - Data Privacy Essay Task - Write an essay (aim for 750 words) that addresses issues associated with data proivacy. Use the Australian Privacy Principles - discussed in class ...

Systems analysis project scenic routes operates a bus

Systems analysis project Scenic Routes operates a bus company that specializes in travelling on secondary roads, rather than Interstate highways. Their slogan is: "It Takes a Little Longer, But It's Scenic." The firm nee ...

The groceries datasetimagine 10000 receipts sitting on your

The groceries Dataset Imagine 10000 receipts sitting on your table. Each receipt represents a transaction with items that were purchased. The receipt is a representation of stuff that went into a customer's basket. That ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As