Question

Problem 1: You do not need Azure SQL for this problem Do the following. a) Write a description for the attached ER diagram. b) Convert the attached ER diagram to a Relational Database. c) Draw a Schema Diagram for the relational database. Paseenger Empbyee Name Firet Name Last Name @nal Address》 Fiet Nam Trains La3t Name Hire Dsie Service Years Cate Ride Licenoe d Licence Cis88 Licenoe. Expiraton City 2IP Taxi Cotfcation Date Date Parking Spot arks Overnigh Spot Number Has

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

a) This ER diagram describes the relationship between Passenger, taxi, driver, parking_complex , mechanic and Employee.
i.e basically it describes a database of any cab provider, cab provider have a relationship with employee, driver,
passenger, parking_complex and mechanic. So we can say it is all about Transport system.

Employee have Unary relationship(trainee, trainer) and class Hierarchi with Employee (Driver, Mechanic).

answer b & c>

create table passenger(
passenger_id varchar(30),
first_name varchar(30),
last_name varchar(30),
email_add varchar(30),
primary key(passenger_id));

create table ride(
ride_id varchar(30),
ride_date date,
driver_id varchar(30),
taxi_id varchar(30),
primary key(ride_id));

create table taxi(
taxi_id varchar(30),
make varchar(20),
model varchar(20),
year varchar(4),
primary key(taxi_id));

create table parking_spot(
spot_number int,
level int,
parking_complex_id varchar(30),
primary key(spot_number, parking_complex_id));

create table parking_complex(
parking_complex_id varchar(30),
name varchar(30),
loc_numer varchar(30),
loc_street varchar(30),
loc_city varchar(30),
loc_state varchar(30),
loc_zip varchar(30),
primary key(parking_complex_id));

create table parks_overnight(
spot_number int,
parking_complex_id varchar(30),
taxi_id varchar(30),
primary key(parking_complex_id, taxi_id));

create table employee(
ssn varchar(30),
firstname varchar(30),
lastname varchar(30),
hire_date date,
service_years int,
trainer_id varchar(30),
primary key(ssn));

create table driver(
ssn varchar(30),
licence_id varchar(30),
licence_class varchar(30),
licence_expiration varchar(4),
primary key(ssn));

create table mechanic(
ssn varchar(30),
con_type varchar(30),
con_date date,
primary key(ssn));

create table services(
ssn varchar(30),
service_id varchar(30),
taxi_id varchar(30),
service_date date,
primary key(ssn, service_id));

mysql> create database transport; Query OK, 1 row affected (0.03 sec) mysql> use transport; Database changed mysql> create table passenger( ->passenger_id varchar(30), -> first_name varchar (30), -> last_name varchar (30), - email_add varchar (30), ->primary key (passenger_id)); Query OK, 0 rows affected (0.20 sec) mysql> mysql> create table ride( ->ride id varchar(30), -> ride_date date, -> driver_id varchar (30), -> taxi_id varchar (30), -> primary key(ride_id)); Query OK, 0 rows affected (0.12 sec)

Add a comment
Know the answer?
Add Answer to:
Problem 1: You do not need Azure SQL for this problem Do the following. a) Write...
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
  • ***SQL DML*** Write SQL statements to answer the following questions. Note that you do not need...

    ***SQL DML*** Write SQL statements to answer the following questions. Note that you do not need data tuples to answer these questions. Use the following relational schema. Supplier (sid, name, status, city) Part (pid, name, color, weight, city) Job (jid, name, city) Supplies (/sid/, /pid/, /jid/, quantity) Use subquery, what are the id and the name of all suppliers, whose total quantity is larger than the total quantity of all suppliers in city ‘London’?

  • Q.1] Write SQL statements based on the tennis database schema (practice homework 5) Get all the different tow...

    Q.1] Write SQL statements based on the tennis database schema (practice homework 5) Get all the different town names from the PLAYERS table. 2. For each town, find the number of players. 3. For each team, get the team number, the number of matches that has been played 'for that team, and the total number of sets won. 4. For each team that is captained by a player resident in "Eltham", get the team number and the number of matches...

  • Question 1.Write a SQL statement for each of the following questions based on the above tables...

    Question 1.Write a SQL statement for each of the following questions based on the above tables (50 Points). 1) Create “Enrollment” table. 2) Change the credits of “Database” course from 2 to 3. 3) List the course titles (not Course_No) and grades John Doe had taken. 4) Calculate average of Café Balance, and name new field as Average Balance. 5) Create a roster for “Database” course (list student ID, last name, first name, major, and status for each student enrolled...

  • ules for submission: 1. All problems must be solved using SQL code. The SQL code and...

    ules for submission: 1. All problems must be solved using SQL code. The SQL code and the output of your query should be cut and pasted into your MS Word file. a. Output Tables must be screenshot from DBMS b. Do not create a MS Word (or other application) table and paste the results into it. c. With the exception of Problems 4, 5 and 6, all output should be the result of a single step. Do not paste outputs...

  • Problem 1 Consider the following set of requirements for a university database that is used to...

    Problem 1 Consider the following set of requirements for a university database that is used to keep track of students' transcripts. (a) The university keeps track of each student's name, student number, social security number, current address and phone, permanent address and phone, birthdate, sex, class (freshman, sophomore, -, graduate), major department, minor department (if any), and degree program (B.A., B.S., ...., Ph.D.). Some user applications need to refer to the city, state, and zip of the student's permanent address,...

  • Problem 1-5 using the table below in the picture to be answered in Microsoft SQL. Thanks...

    Problem 1-5 using the table below in the picture to be answered in Microsoft SQL. Thanks 4. Write SQL queries to answer the following questions, a. How many students were enrolled in secoon 14 b. How many students were enrolled in ISM 3113 5. Write an SOL query to answer the following question Which students were not enrolled in any courses on Problems and Exercises 6 through 14 are based on Figure 7-15. The problem set continues from Chapter 6,...

  • Please generate the queries in SQL given the following: Problem: Analyzing Santa’s Bike Service (20%) The...

    Please generate the queries in SQL given the following: Problem: Analyzing Santa’s Bike Service (20%) The Santa Bike Service provides rental bicycles in San Francisco. It distributes these bikes through several completely automated stations, each with a number of bike docks for securely parking a rental bike. Users can rent these bicycles by visiting Santa’s website, choosing their preferred station for pick-up, and paying for their rental. The website will generate a reservation code for their use. They can head...

  • SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do...

    SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do steps after. First 3 tables are after the first 2 images for reference if needed. //1// CREATE TABLE kr_customer ( Name VARCHAR(40) NOT NULL PRIMARY KEY, City VARCHAR(20), Status CHAR(1) ); //2// CREATE TABLE kr_salesperson ( Name VARCHAR(40) NOT NULL PRIMARY KEY, Age INT, Salary DECIMAL(8, 2) ); //3// CREATE TABLE kr_order ( Order_Number number(3) NOT NULL PRIMARY KEY, Customer_Name VARCHAR(40), Salesperson_Name VARCHAR(40), Amount...

  • PROBLEM STATEMENT: Suppose you have a client that has given you the following business rules to...

    PROBLEM STATEMENT: Suppose you have a client that has given you the following business rules to form the basis for a database design. The database must enable the manager of a company dinner club to mail invitations to the club’s members, to plan the meals, to keep track of who attends the dinners, and so on. Each dinner serves many members, and each member may attend many dinners. A member receives many invitations, and each invitation is mailed to many...

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