minimize data redundancy and improve data integrity. It involves organizing the columns and
tables in a database to ensure that each table contains only related data and follows specific
rules. The most common normal forms are:
• First Normal Form (1NF): Each table cell should contain a single value, and there should be no
repeating groups.
• Second Normal Form (2NF): All non-key attributes should be fully dependent on the primary
key.
• Third Normal Form (3NF): All non-key attributes should be non-transitively dependent on the
primary key.
2. Stored Procedures Concepts: A stored procedure is a precompiled set of SQL statements stored
in a database. They can be called by applications, other stored procedures, or triggers to
perform specific tasks. Some benefits of stored procedures include:
• Code reusability
• Improved security
• Better performance
• Centralized control and easier maintenance
3. User-Defined Functions Concepts: User-defined functions (UDFs) are custom functions created
by users in a database. They allow you to encapsulate a series of SQL operations into a single
function that can be called with parameters. Some advantages of UDFs include:
• Code reusability
• Simplified query writing
• Enhanced code readability
• Easier maintenance and debugging
Tables Description: Consider a simplified e-commerce database that contains the following tables:
1. Customers (CustomerID, FirstName, LastName, Email, PhoneNumber, StreetAddress, City, State,
ZipCode, Country)
2. Products (ProductID, ProductName, Category, Description, Price, QuantityInStock)
3. Orders (OrderID, CustomerID, OrderDate, TotalAmount)
4. OrderDetails (OrderDetailID, OrderID, ProductID, Quantity, Price)
Tasks:
1. MySQL Normalization: Normalize the given tables into 3NF (Third Normal Form). Clearly define
the primary keys (PK) and foreign keys (FK) for each table after normalization.
2. MySQL Stored Procedures: Create three stored procedures for the normalized tables.
a. Insert a new customer and their order information.
b. Update the quantity in stock for a product after an order is placed.
c. Retrieve the total sales for a specific product within a specified date range.
3. MySQL Functions: Create two user-defined functions for the normalized tables.
a. Calculate the average price of products in a specific category.
b. Determine the total number of orders placed by a specific customer
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
- MINI PROJECT news Paper database system The databases must include a minimum of 6 tables Design a Database showcasing your skills in building relationships between tables Apply Joins, Alter, Update, Group by, SET operators Use of Constraints (Integrity Referential, Check) and ,Constraints-Primary key, Not Null, Default Managing Concurrency Control, Deadlock, and Distributed Systems Perform all operations like Insert delete, Access data by applying joins Implementation using PL/SQL-declare begin to end. Procedures, Functionsarrow_forwardPart Design a database for an Access Control System. The purpose of the system is to control who has access to which doors at what time. There are six entities in this database: ● ● Users Groups O A user can be assigned to more than one group. Doors AccessRules O Decides which Group has access to which Door at which TimeSchedule. Example: Group A can access the Front Door on Monday from 7am to 9pm. o o Example: Group B can access the Back Door on Saturday from 8am to 10pm. TimeSchedules To make it simple, we only need to pport Weekly Schedules. The TimeSchedules table has the following columns: Id O O DayOfWeek StartTime ■ EndTime o Example: a schedule with DayOfWeek-Monday, StartTime=7:00, EndTime=23:00 means this schedule grants access on Monday from 7am to 11pm. Entrance Logs O This table keeps a permanent record of which user accessed which door at what time. o The logs must remain valid even after the related records have been updated. For example, after user X is deleted, the…arrow_forwardDescribe the concept of sharding in the context of database architecture.arrow_forward
- Database Systems: Design and Applicationarrow_forwardIn a relational database, a select operation may reduce the size of a table by removing columns that don't meet a set of criteria.arrow_forwardEach of the following methods for storing a relational database has two benefits and two drawbacks. Create a separate file for each relationship.arrow_forward
- Database & Python ETL Provision one database of your choosing (SQL, NoSQL, Graph). Write a python ETL that ingests the provided data, transforms it in some way, and loads it into the database.arrow_forwardRelations describe the intersection between two axes, x and y. For example, a table (tuple) found in a database contains columns (attributes) and rows (records or observations). Database and Geospatial Mapping Application developers rely on tables and cartesian coordinate systems to adhere to the rules of relational database theory so that integrity in the location is preserved. Tables should only contain records that relate to the columns found in that table and the data domain determines what records should be stored in a given table. Database administrators can check for integrity in relationships within and between tables using structured query language (SQL). What other computer-science or IT jobs rely on relations?arrow_forwardDatabase Design [Image below] Before essential oil products are marketed, testing is carried out based on the production batch of each essential oil. This is done to maintain the quality and content of the constituents in the essential oil. Where the Test Percentage Content must reach the Minimum Percentage Content standard for each constituent. If there is one type of constituent that does not meet the minimum standards, the batch will not be marketed because it does not meet the quality standard. 1. If recording the results of each testing process is still done manually, in your opinion, please explain which approach is suitable between Centralized and View Integration for collecting requirements. 2. What Fact Finding methods will you choose to obtain information related to the development of a database system to record the testing process, and explain the reasons for choosing it.arrow_forward
- Problem: design a er diagram for a database to keep track of building inspections required by a department of Damaged Buildings (DB). DB building inspections are requested by builders every month. Each building inspection is either passed or not. Inspections have a type code (3 characters, e.g. PLU, FRM, ELE, etc.) and possibly sequencing requirements. Some inspections cannot be performed before other inspections, e.g. final plumbing inspection cannot be performed until the framing inspection is passed. Each inspection has a numeric score, with 75 or more out of 100 being sufficient for a pass status. Each inspection data contains the date of inspection, inspector identification, inspection score, and textual information about the inspection. The textual information can be updated later, but the score can never be changed. FODB maintains a pool of inspectors. Each inspector has a unique 5 digit employee ID, name, and date they were hired. They can conduct any type of inspection but…arrow_forwardIn a relational database, a select operation is used to minimise the size of a table by eliminating columns that fulfil certain criteria.Is this the right answer or the wrong answer?arrow_forwardDescribe the benefits of using a data dictionary in the database design phase.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education