Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Base on the database, please draw the ERD diagram not coding. Based on your class diagram your database definetly includes 8 tables. Based upon the

Base on the database, please draw the ERD diagram not coding.

image text in transcribed

image text in transcribed

image text in transcribed

Based on your class diagram your database definetly includes 8 tables. Based upon the nature and functionality of our project you can add more tables. Lets say we have a database named 'carrent'. Lets create the tables for this database. a) Tablename: carrent.car CREATE TABLE carrent.car( car_id INT PRIMARY KEY, car_number VARCHAR(10) NOT NULL, car_type VARCHAR(10), car_category VARCHAR(25), car_description VARCHAR(150), car_owner_id INT NOT NULL) b) Tablename: carrent.drivers CREATE TABLE carrent drivers drivers_id INT PRIMARY KEY, drivers_name VARCHAR(15) NOT NULL, drivers_mobile VARCHAR(12) NOT NULL, drivers_address VARCHAR(100), drivers_email VARCHAR(50) NOT NULL, drivers_password VARCHAR(25) NOT NULL, drivers_username VARCHAR(25) NOT NULL) c) Tablename: carrent.passenger CREATE TABLE carrent.passenger passenger_id INT PRIMARY KEY, passenger_name VARCHAR(15) NOT NULL, passenger_mobile VARCHAR(12) NOT NULL, passenger_address VARCHAR(100) passenger_email VARCHAR(50) NOT NULL, passenger_password VARCHAR(25) NOT NULL, passenger_username VARCHAR(25) NOT NULL) d) Tablename: carrent.carroute CREATE TABLE carrent.carroute car_route_id INT PRIMARY KEY, car_route_type VARCHAR(30) NOT NULL, car_route_description VARCHAR(100) NOT NULL, car_route_name VARCHAR(25)) e) Tablename: carrent.permission CREATE TABLE carrent permission permission_id INT PRIMARY KEY, permission_role_id INT NOT NULL, permission_title VARCHAR(25) NOT NULL, permission_module VARCHAR(50), permission_description VARCHAR(150)) f) Tablename: carrent.booking CREATE TABLE carrent.booking permission_description VARCHAR(150)) f) Tablename: carrent.booking CREATE TABLE carrent.booking booking_id INT PRIMARY KEY, booking_title VARCHAR(15) NOT NULL, booking_description VARCHAR(100) NOT NULL, booking_type VARCHAR(15) NOT NULL, booking_ticket VARCHAR(15) NOT NULL, booking_date DATE NOT NULL) g) Tablename: carrent.role CREATE TABLE carrent.role role_id INT PRIMARY KEY, role_title VARCHAR(15) NOT NULL, role_description VARCHAR(100)) h) Tablename: carrent.user CREATE TABLE carrent.user user_id INT PRIMARY KEY, user_role_id INT, user_name VARCHAR(15) NOT NULL, user_address VARCHAR(100), user_email VARCHAR(50) NOT NULL, user_dob DATE) Explanation Please refer to solution in this step. Answer Dear Student, According to the given class diagrams, I had created 8 tables under database named carrent. In the given tables, I had added all id as primary keys. I am not sure about the foreign keys in the project. For example the class user contains a field named user_role_id which may be the one taken from the table role i.e the field role_id. If so in the table user please give it as foreign key. Also I had made some fields not null which indicate that these fields should never be left empty. You can check it yourself and based on your project set the fields that should not be null. I had made a guess work of this not null fields as I am not aware about your project so I suggest you to check for the importance of each fields in the table and check whether it should be given as not null or not. I hope this will be helpful for you. Thankyou v rent-a-car system car id : int(11) number: varchar(10) e type : varchar(10) e category : varchar(25) a description : varchar(150) # ownerlD : int(11) v rent-a-car system drivers & id: int(11) e name : varchar(15) @mobile: varchar(12) e address : varchar(100) @email: varchar(50) @password: varchar(25) username : varchar(25) v O rent-a-car system role id: int(11) title : text decription : varchar(100) v O rent-a-car system passenger id: int(11) @name : varchar(15) @mobile : varchar(12) address : varchar(100) @email : varchar(50) e password : varchar(25) e username : varchar(25) v rent-a-car system permission id : int(11) # rolelD : int(11) title : varchar(25) module : varchar(50) description : varchar(150) v rent-a-car system carroute aid: int(11) e type : varchar(30) e description : varchar(100) e name : varchar(25) V O rent-a-car system user & id: int(11) # rolelD : int(11) e name : varchar(15) e address : varchar(100) email: varchar(50) D.O.B : date vo rent-a-car system booking & id : int(11) e title : varchar(15) decription : varchar(100) e type : varchar(15) e ticket : varchar(15) date : date

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

Students also viewed these Databases questions

Question

Is the person willing to deal with the consequences?

Answered: 1 week ago