Mis Lab
Mis Lab
Mis Lab
Include tables for books, authors, customers, and orders. Provide SQL
commands for table creation and insert sample data.
2) Write an SQL query to find all customers who have purchased books in
the last 30 days, along with the book titles and order dates.
INNER JOIN
An INNER JOIN returns only the rows that have a match in both tables.
LEFT JOIN
A LEFT JOIN returns all the rows from the left table and the matching rows from the
right table. If there is no match, the result is NULL on the right side.
RIGHT JOIN
A RIGHT JOIN is similar to a LEFT JOIN, but it returns all the rows from the right table
and the matching rows from the left table.
i) CRM Strategy
Customer relationship management is a strategy that reinforces the
continuous nurturing of customer relationship to increase revenue and
profitability. Despite a standard focus on building customer relationships,
every company will have its own slightly different take on what its CRM
strategy should look like. What won’t change is the role of CRM strategy as
the high-level, big-picture outline of a CRM architecture.
Create Operation
The Create operation is used to create a new table.
Insert Operation
This command inserts a new row into the "customers" table with the name "John
Doe” and email [email protected]
Read Operation
The Read operation is used to retrieve data from a table
Update Operation
The Update operation is used to modify existing data in a table. This command updates
the email address of the customer with the name "John Doe" to "[email protected]".
Delete Operation
The Delete operation is used to delete data from a table. This command deletes the row
from the "customers" table where the name is "John Doe".
11) Create a stored procedure to calculate the total sales for a specific
month. Demonstrate how to execute this procedure.
This stored procedure takes two input parameters: @month and @year, which
represent the month and year for which we want to calculate the total sales. The
procedure uses a SELECT statement to sum up the ‘Total’ column of the ‘Sales’ table,
filtering the results to only include sales that occurred in the specified month and year.
To execute the stored procedure, we can use the following command:
Output:
Here is an example of a trigger that updates the stock quantity in the database
whenever a new order is placed:
This trigger is created on the Orders table and is triggered after a new order is
inserted. The trigger updates the StockQuantity column of the Products table by
subtracting the quantity of the product ordered from the current stock quantity.
13) Design a simple form in a database management system to enter
new customer details. Create a report to display all customers and their
contact information.
Output:
14) Discuss methods for encrypting sensitive data in a database.
Provide an example of how encryption can be implemented in SQL.
Data loss prevention: Regular backups ensure that data is safe in case of
hardware failure, software corruption, or human error.
Business continuity: Backups enable quick recovery in case of a disaster,
minimizing downtime and ensuring business continuity.
Version control: Backups provide a history of changes, allowing for easy
rollbacks to previous versions if needed.
Here are some ways that indexing can improve the performance of SQL queries:
Faster data retrieval.
Reduced disk I/O.
Improved query optimization.
Better support for filtering and sorting.
Creation of Index:
Indexing.
Optimize Queries.
Partitioning.
Caching
Database Fragmentation.
Identifying Bottlenecks:
Use Database Performance Monitoring Tools.
Analyze Query Execution Plans.
Monitor System Resources.
Collect Database Statistics.
Identify the business needs and goals for the new MIS.
Determine the key performance indicators (KPIs) to be tracked.
Establish a project timeline and budget.
Conduct a Needs Assessment:
Interview stakeholders to gather requirements.
Analyze existing business processes and systems.
Identify areas for improvement and opportunities for automation.
Unit Testing:
Test individual components and modules of the MIS.
Ensure that each component functions as expected.
Integration Testing:
Test the integrated system to ensure that all components work together
seamlessly.
Identify and resolve any integration issues.
Train End-Users:
Post-Implementation Review:
Conduct a post-implementation review to identify lessons learned.
Refine the system and make any necessary adjustments.