Mini-Project 231-CIS - LAB SET-B
Mini-Project 231-CIS - LAB SET-B
Assessment Description:
This assessment is well-designed to cover most topics of the database including DDL, DML, TCL data retrievals in
terms of Select, join, and View. Some parts of PL/SQL are also included such as functions, procedures, and triggers.
It aims to measure students’ understanding and performance in regard to how to implement a simple relational
database based on given specifications. students will use Oracle tools, such as SQL developer, to do the following
tasks. Firstly, students will create relational tables and maintain referential integrity during data insertion. Secondly,
students apply the appropriate SQL commands for data retrieval. Finally, students will build some named PL/SQL
blocks and execute them. In regards to skills, students will gain opportunities to improve their skills including
problem solving, teamwork, and leadership, taking responsibility, and making effective communication. The
expected outcome is a completely implemented relational database with an Oracle tool according to the predefined
requirements.
Instructions
1. Read the case study carefully and attempt all tasks.
2. You must strictly follow what has been mentioned in the project. This is to save your time and to avoid any
issues that may come up during your work.
3. Use any Oracle SQL Command-Line to execute your commands(SQL Developer - https://livesql.oracle.com/ )
4. This activity should be done by a team of 3 members only if applicable. Your collaboration has been facilitated
via allocating a group for each team on Blackboard.
NOTES:
● If any student decided to work alone, he/she will lose 1 point from the final total mark
● If the student did not join a group and did not submit the activity will get zero marks.
5. As a team, all members must have equal contributions to the activity.
6. If you have any doubt, you can ask the lab instructor during lab sessions or at his office 1-2-99.
7. Assessment Criteria:
7.1. You must implement the activity yourself. Any attempt of cheating will result in your failure in the course.
7.2. Activity evaluation:
7.2.1. Full make > submitting a completely implemented relational database + working hard with your team.
7.2.2. Otherwise, your work will be assessed according to your effort and contributions to the activity.
7.2.3.Zero marks > late submission
7.2.4.Zero marks + failure > cheating.
8. Submission:
8.1. Use the given answer sheet to add all of your answers in the form of screenshots of the codes.
8.2. Please arrange your answers according to task order in order to make your answers clear and neat.
8.3. Fill the agreement form with your team members to specify the contributions of each member to the project
and how much parentage of marks should be given for each member.
8.4. You must submit your work at the specified time on or before 16/02/2023,11:59 AM.
8.5. Late submission will increase your absent percentage by %5.
8.6. You must submit only the filled answer sheet.
9. According to the department’s instructions, all possible cheat cases and late submission will be collected and
sent to the department in order to take further action.
10. The leader of each team must submit the group work.
1
A) Case Study:
Mr. X seriously loves Arabic food so in the beginning of 2021, he decides to embark upon a risky venture and opens
up a cute little restaurant that sells his 5 favourite foods: Mandi, Kabse, Mutabbaq, Hanees and Hashi.
Mr. X is in need of your assistance to help the restaurant stay afloat - the restaurant has captured some very basic
data from their few months of operation but have no idea how to use their data to help them run the business. Mr. X
has provided you with a sample of his overall customer data due to privacy issues - but he hopes that these examples
are enough for you to write fully functioning SQL queries to help him answer his questions!
Mr. X has shared with you 3 key datasets for this case study:
• Sales
• Menu
• Members
You can inspect the entity relationship diagram and example data below
1. Sales: The sales table captures all customer_id level purchases with an order_date and product_id information
for when and what menu items were ordered.
2
3. Member: The final members table captures the join_date when a customer_id joined the beta version of
the Mr. X loyalty program.
Use SQL Developer or Oracle Live SQL to write the appropriate SQL commands as follows:
A) Create the sales, menu and member tables according to the given specifications above. [LAB-3] (1)
B) Use the INSERT commands to add all tuple information as per tables given above. (1)
C) Mr. X is no longer wants to keep ‘Kunafa’ in the menu table, so he wants to remove it. [LAB-3] (1)
Use SQL Developer or Oracle Live SQL to write the appropriate SQL commands as follows:
A) Find out all the customers who ordered only product whose id is 1 & 3. The results should order based on
the customer ID. [LAB-4] (1)
B) Based on sales table, create a view called ‘product_view’ that displays customer id and product id for those
customers who did not order whose product id is 1 [LAB-4][LAB-6] (1)
C) Join both Sales and Menu tables and display all customer id, product id, product name, price of those
product ordered by customers. [LAB-6] (1)
D) From both Sales and Menu tables, retrieve all Customer ID, product id, product name and price regardless of
those product ordered customers or not. [LAB-6] (1)
E) Display product id, product name, price and 15% added vat of the original price. [LAB-4] (1)
Use SQL Developer or Oracle Live SQL to write the appropriate SQL commands as follows:
A) FUNCTION: Use the menu table to create a function called ‘Return_name’ which accepts an input
parameter ‘customer_id’ and print the name of the product with that id. Then execute this function with
product_id = 2. [LAB-7] (1)
B) Trigger: Create a row-level trigger called ‘Compute_Price_trigger’ on the menu table to automatically
update the price for each item after inserting or updating price on the menu table. Additionally, this trigger
must show this statement ‘TRIGGER MESSAGE: The price of product_name is modified successfully'.
Then test your trigger by updating the menu table. For example, update the price of the product ‘Mandi’ to
70 whose product_id is 1. [LAB-7] (1)
If you have any questions, please do not hesitate to contact the lab instructor via email or lectures.
My Best Wishes,