0% found this document useful (0 votes)
9 views

Advance database Assignment 1-1

The document outlines the requirements for submitting an assignment involving database design and implementation for a fictional company and an e-commerce platform. It includes tasks such as creating ERDs, normalizing databases, implementing SQL queries, and ensuring security and backup strategies. Additionally, it specifies deliverables and evaluation criteria for the assignment, which must be submitted as a single ZIP file by a set deadline.

Uploaded by

kuma francis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Advance database Assignment 1-1

The document outlines the requirements for submitting an assignment involving database design and implementation for a fictional company and an e-commerce platform. It includes tasks such as creating ERDs, normalizing databases, implementing SQL queries, and ensuring security and backup strategies. Additionally, it specifies deliverables and evaluation criteria for the assignment, which must be submitted as a single ZIP file by a set deadline.

Uploaded by

kuma francis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Must Read this before

Submit all deliverables as a single ZIP file to the course reps with the format your index number
underscore ASSIGNMENT-1 (00000000_ASSIGNMENT-1) from 8:00 am to 10:00pm lately,
because the course reps are expected to send the work as ADVANCE_DBMS_ASS-1 to me
from 10: 30pm to 11:00pm even by 11:01pm is late Today(6th June, 2024). Course reps are
expected to ignore anyone who will cause late submission, else the entire work will be turn
down.

Concerning the question, the questions have been grouped into two section which are SECTION
A and B, your are required to answer one question from each section, in all you will answer two
questions.
SECTION A (Answer only one question from this section)

QUESTION 1

Objective

To design and implement a comprehensive database system for a fictional company,


demonstrating advanced database management skills.

Scenario

You have been hired as a database consultant for "Global Tech Solutions," a multinational
technology company. Your task is to design and implement a database system that supports
various aspects of the company's operations, including customer management, sales, inventory,
employee management, and financial transactions.

Tasks

1. Database Design
· Design an ERD (Entity-Relationship Diagram) that includes at least the following
entities: Customers, Orders, Products, Employees, Inventory, Suppliers, and
Transactions.
· Ensure that the relationships between entities are clearly defined, including one-to-many,
many-to-many, and one-to-one relationships.
· Normalize your database schema to the 3rd Normal Form (3NF) and provide a detailed
explanation of how you achieved normalization.
1. SQL Implementation
· Create the database and all tables using SQL.
· Insert sample data into the tables. Each table should have at least 20 records.
· Write SQL queries to perform the following tasks:
· Retrieve a list of all customers who have made purchases in the last month.
· Generate a report of the top 10 best-selling products.
· Find the employees who have processed the highest number of orders.
· Calculate the total sales revenue for the past quarter.
1. Transactions and Concurrency Control
· Implement a transaction that simulates a customer placing an order, including updating
inventory levels and recording the transaction in the sales ledger.
· Demonstrate how to handle concurrency control using transactions and locks to ensure
data integrity during simultaneous access by multiple users.
1. Indexing and Performance Optimization
· Create indexes to optimize the performance of your queries.
· Use EXPLAIN or a similar tool to analyze the performance of your queries before and
after indexing. Provide a report on the performance improvements.
1. Security
· Implement user roles and permissions to restrict access to sensitive data. For example,
only allow managers to view financial transactions and employee records.
· Demonstrate how to encrypt sensitive data such as customer credit card information.
1. Backup and Recovery
· Design a backup strategy for your database, including both full and incremental backups.
· Write a script to automate the backup process.
· Simulate a database failure and demonstrate how to recover the database from backups.
1. Data Warehousing and ETL
· Design a simple data warehouse schema to support business intelligence reporting for the
company.
· Implement an ETL (Extract, Transform, Load) process to populate your data warehouse
with data from the operational database.
· Create a report using a business intelligence tool (e.g., Power BI, Tableau) to visualize
key performance indicators (KPIs) for the company.
1. Documentation and Presentation
· Provide detailed documentation for your database design, including the ERD,
normalization steps, SQL scripts, indexing strategy, security measures, and
backup/recovery plan.
· Prepare a presentation (slides) summarizing your work, including key findings and
improvements achieved through indexing and performance optimization.

Deliverables

· ERD Diagram
· SQL scripts for database creation and data insertion
· SQL queries for specified tasks
· Transaction and concurrency control implementation
· Indexing and performance optimization report
· Security implementation details
· Backup and recovery strategy and scripts
· Data warehousing and ETL implementation
· Business intelligence report
· Documentation and presentation slides

Question 2

Overview

You are tasked with designing and implementing a database for a large e-commerce company
that sells a wide variety of products. The database must be able to handle millions of products,
customers, orders, and transactions. It should support advanced features like recommendations,
personalization, and analytics.
Requirements

1. Entity-Relationship Diagram (ERD): Create an ERD that models the following


entities:
· Products
· Customers
· Orders
· Order_Items
· Payments
· Reviews
· Recommendations
· Categories

1. Normalization: Normalize the database to at least the 3rd Normal Form (3NF).
2. Indexing: Identify and implement appropriate indexes to optimize query performance
for the following scenarios:
· Retrieving products by category
· Finding customers by email or phone
· Searching for orders by customer ID or order date range
· Calculating total revenue for a given time period

1. Stored Procedures and Functions: Create stored procedures and functions for the
following tasks:
· Placing a new order
· Updating the inventory count when an order is placed
· Calculating the average rating for a product
· Generating personalized product recommendations for a customer based on their order
history and reviews
1.
2. Triggers: Implement triggers to automatically update the following:
· Total revenue when a new payment is added
· Average rating when a new review is added
· Inventory count when an order is placed or cancelled
1.
2. Views: Create views for the following scenarios:
· Displaying the top 10 best-selling products in each category
· Showing the order history for a given customer
· Listing all products with their average rating and number of reviews
1.
2. Transactions: Ensure that the following operations are atomic, consistent, isolated, and
durable (ACID):
· Placing an order (including creating order items and updating inventory)
· Processing a payment
· Updating a customer's address or contact information
1.
2. Security: Implement appropriate security measures, such as:
· Role-based access control (RBAC) for different user types (e.g., admin, customer,
employee)
· Encryption for sensitive data (e.g., customer passwords, payment information)
· SQL injection protection
1.
2. Backup and Recovery: Develop a backup and recovery strategy to ensure data integrity
and availability in case of system failures or data loss.
3. Documentation: Provide comprehensive documentation for the database design,
implementation, and usage.

Deliverables

1. ERD diagram
2. SQL scripts for creating tables, indexes, stored procedures, functions, triggers, and views
3. Test cases and results for validating the database functionality
4. Documentation covering the database design, implementation, and usage

Evaluation Criteria

1. Completeness: Does the database meet all the requirements specified in the project
description?
2. Normalization: Is the database normalized to at least the 3rd Normal Form (3NF)?
3. Performance: Are the appropriate indexes and optimizations implemented to ensure
efficient query performance?
4. Functionality: Do the stored procedures, functions, triggers, and views work as
expected?
5. Security: Are the appropriate security measures implemented to protect the data?
6. Backup and Recovery: Is there a well-defined backup and recovery strategy in place?
7. Documentation: Is the documentation clear, comprehensive, and easy to understand?
SECTION B (Answer only one question from this section)

Question 1

Introduction

EcoFleet is a rapidly growing startup revolutionizing eco-friendly transportation solutions. They


operate a ride-sharing platform that connects users with environmentally conscious drivers. As
their database architect, you're tasked with designing and implementing a robust NoSQL
database system using MongoDB to handle their diverse data needs.

Business Requirements

1. User Profiles: Collect detailed user information, including demographics, preferences,


payment methods, and ride history.
2. Ride Requests: Manage incoming ride requests, including user location, destination,
preferred vehicle type, and estimated fare.
3. Driver Information: Store driver profiles, vehicle details, availability, ratings, and
earnings.
4. Payments: Track payment transactions, including ride fares, tips, discounts, refunds, and
payment status.
5. Ratings and Reviews: Allow users to rate drivers and leave reviews, with options for
feedback and dispute resolution.
6. Analytics and Reporting: Generate reports on ride trends, revenue streams, driver
performance, user satisfaction, and market insights.

Data Modeling Challenges

· Dynamic Schema: Users may have varying profile attributes based on their membership
level or preferences.
· Nested Data: Store ride details within user profiles and aggregate statistics within driver
documents.
· Temporal Data: Track historical changes to user preferences, driver availability, and
payment statuses.
· Geospatial Queries: Support location-based queries for ride matching, driver allocation,
and proximity searches.

Implementation Details

1. Database Design: Utilize MongoDB's document-oriented model to represent entities as


collections and embed related data within documents.
2. Data Ingestion: Populate the database with diverse sample data, including users from
different regions, ride scenarios, driver profiles, payment histories, and review feedback.
3. Query Optimization: Write efficient MongoDB queries using aggregation pipelines,
indexes, and projection to retrieve relevant information quickly.
4. Security Measures: Implement authentication mechanisms, role-based access control,
and encryption for sensitive data fields.
5. Scalability Planning: Design a scalable architecture using MongoDB's sharding
capabilities to handle increasing data volumes and concurrent user requests.
6. Backup and Recovery: Develop a robust backup strategy with automated backups,
point-in-time recovery options, and disaster recovery procedures.

Conclusion

By successfully designing and implementing a NoSQL database system for EcoFleet, you'll
demonstrate advanced skills in data modeling, query optimization, security, scalability, and
disaster recovery planning. The complex nature of EcoFleet's operations will challenge you to
think critically and creatively to meet their evolving data management needs.

Question 2

Background

E-commerce giant, "GlobalBuy," operates in over 100 countries, offering a vast array of products
to its customers. The company's e-commerce platform is built on a monolithic architecture,
which has become a bottleneck in terms of scalability and performance. To address these issues,
GlobalBuy has decided to migrate its database to a NoSQL solution.

Requirements

1. Scalability: The NoSQL database must be able to handle a massive volume of data, with
a projected growth rate of 20% per quarter.
2. Performance: The database must be able to handle high query loads, with an average
query response time of less than 100 milliseconds.
3. Data Variety: The database must be able to handle diverse data types, including
structured, semi-structured, and unstructured data.
4. Data Distribution: The database must be able to distribute data across multiple nodes,
ensuring high availability and fault tolerance.
5. Security: The database must be able to enforce robust security measures, including
authentication, authorization, and encryption.
6. Data Retrieval: The database must be able to efficiently retrieve data for various use
cases, including:
· Retrieving products by category
· Finding customers by email or phone
· Searching for orders by customer ID or order date range
· Calculating total revenue for a given time period
1.
Challenges

1. Data Integration: GlobalBuy has multiple legacy systems, each with its own data format
and schema. The NoSQL database must be able to integrate data from these systems
seamlessly.
2. Data Consistency: The NoSQL database must ensure data consistency across multiple
nodes, despite the high volume of data and concurrent updates.
3. Data Retrieval: The NoSQL database must be able to efficiently retrieve data for various
use cases, considering the diverse data types and large volume of data.

Task

Design and implement a scalable NoSQL database for GlobalBuy's e-commerce platform. The
database should meet the requirements and challenges outlined above. Provide a detailed design
document, including:

1. NoSQL Database Selection: Choose a suitable NoSQL database engine and justify your
selection based on the project requirements.
2. Data Modeling: Design a data model for the e-commerce platform using the chosen
NoSQL database. Ensure that the model is scalable, flexible, and efficient for handling
diverse data types.
3. Indexing and Query Optimization: Implement appropriate indexing and query
optimization techniques to ensure efficient data retrieval and query performance.
4. Data Storage and Retrieval: Implement data storage and retrieval mechanisms to handle
large volumes of data efficiently. Ensure that data is stored in a way that allows for fast
retrieval and querying.
5. Data Consistency and Durability: Implement mechanisms to ensure data consistency
and durability in the NoSQL database. This includes handling concurrent updates and
ensuring that data is persisted correctly.
6. Security and Authorization: Implement appropriate security measures to protect the
NoSQL database from unauthorized access and ensure that data is accessed only by
authorized users.
7. Backup and Recovery: Develop a backup and recovery strategy to ensure data integrity
and availability in case of system failures or data loss.

Deliverables

1. NoSQL database design diagram


2. SQL scripts for creating tables, indexes, and queries
3. Test cases and results for validating the database functionality
4. Documentation covering the database design, implementation, and usage

Evaluation Criteria

1. Completeness: Does the NoSQL database meet all the requirements specified in the
project description?
2. Scalability: Is the NoSQL database designed to handle large volumes of data and scale
efficiently?
3. Performance: Are the indexing and query optimization techniques effective in ensuring
efficient data retrieval and query performance?
4. Security: Are the security measures implemented to protect the NoSQL database from
unauthorized access and ensure data integrity?
5. Documentation: Is the documentation clear, comprehensive, and easy to understand?

Additional Requirements

1. Justification: Provide a detailed justification for your NoSQL database selection and
design choices.
2. Comparison: Compare your NoSQL database design with other possible designs,
highlighting the advantages and disadvantages of each approach.
3. Future Development: Discuss potential future developments and enhancements for the
NoSQL database, including scalability, performance, and security improvements.

You might also like