Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

IS 633 University of Maryland Baltimore Train Database PL SQL Code Problems

IS 633 University of Maryland Baltimore Train Database PL SQL Code Problems

Question Description

TRAIN DATABASE

You will create a database to store metro stations, lines, and schedules. Please carefully read the following assumptions:

  • There are multiple lines and multiple train stations.
  • Each line has multiple stations and each station can be on multiple lines. So, we use a line_station table to keep track of which station is on which line. To specify the order of stations, each row in line_station has a sequence number. For example, if station A has sequence number 1 on line B, it means station A is the first station of line B. Sequence number 2 means the second station and so on.
  • Each line has multiple schedules. You can think of a schedule as a row in a time table in the real world (a sample time table is given at the bottom of the page).
  • The Schedule_station table stores the scheduled arrival time of a train at a station on a given schedule. For example, in schedule 1 the train may arrive at station 1 at 7:30 am and arrive at station 2 at 7:40 am, and so on.
  • To represent time during the day such as 7:30 am, we use interval day to second data type (i.e., count the gap from 12 am). For example, 7:30 am is represented as interval ‘7:30:00.00’ hour to second.
  • A passenger can transfer to a different line at a station that is on multiple lines


*use attached word document (which is in pl/sql code) as the database from which to complete tasks


Part 1 – Write ONE SQL statement to implement each of the following tasks.

You can ONLY use conditions listed in each task. Your statements need to work regardless of what data are in the database. E.g., if we look for a station with a certain name, you cannot manually look up the station’s ID.

Task 1: Return the number of stations on the green line.

Task 2: Update the status of Chinatown station to open

Task 3: Return the number of lines each station is on, along with station id.

Task 4: Return the names of stations on the green line.

Task 5: Return names of stations that are on multiple lines. Please return both station name and count of lines the station is on.

Task 6: Return all schedules passing Chinatown station. Please include the line name, scheduled arrival time at Chinatown station, and direction of each schedule.

Task 7: Update a line’s status to 3 if some of the stations on the line are closed.

Hint: use a subquery/nested query.

Part 2 – Write an anonymous PL/SQL program to print out the name of the third station (i.e., the sequence number is 3) on the green line. Please use an implicit cursor and handle the exception. In case of exception (no match is found), print out a message ‘No such station’.

Part 3 – Suppose a passenger wants to leave at greenbelt station between 7:30 am to 8:30 am (including 7:30 and 8:30) and take the green line train in the direction of increasing sequence number. Please write an anonymous PL/SQL program to print out schedule IDs and scheduled arrival time of such schedules at greenbelt station.

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: School Assignment only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by School Assignment are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. School Assignment is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At School Assignment, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.