Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. write the normalization table based on database. 2. Write the relational table. 3. write the data dictionaries Based on your class diagram your database

image text in transcribed

image text in transcribed

1. write the normalization table based on database.

2. Write the relational table.

3. write the data dictionaries

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

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

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions