The following relational database schema stores information about a restaurant. The primary keys are underlined and field types are omitted. Study the schema and its corresponding description to answer the questions Customer (cid, cname, cage, caddress, cphone) Table (tno, capacity, avuilability) Item (iid, iname, price) Order ( oid, cid, iüd, ino, quantity) Employee (eid, ename, caddress, eage, salary) Reservation (rid, eid, cid, date, time) The customer is someone who eats in the restaurant. The Customer relation provides customer id, the name, age, address and phone number information. The Table relation gives the restaurant's occupancy information that includes the table number, the number of people who can sit on the table, and the table's availability information. The restaurant serves several items. Each of the Items has an identification number (e.g 82285), name (e-g, salad), and unit price (e.g.$15). Soon after arrival in the restaurant a customer places an order. Order relation contains order id, customer id, ordered items id, cach item's quantity. Each order contains one or more items, and the quantity of cach item (e.g., order 10 contains one soup and two salads). Here we are assuming that a customer can visit the restaurant at most once in a day and can't place multiple orders at a time. Restaurant employees serve customers. The Employee relation contains employee id, name, address, age, and salary information. The customer can make a reservation in the restaurant beforchand. The Reservation relation records reservation, employee, and customer ids, and reservation date and time. In this question, you will only deal with querying part of SQL. You are NOT allowed to tamper with (change the contents of) the database, ie, CREATE, INSERT, DELETE ALTER, UPDATE ete. i Write a stored procedure to find the name of the employee which are highly paid and have age greater than 30? ii. Write a stored procedure to create a report that shows the employees who made the reservation from "23 march 2021" till "Today" having number of reservations greater than 5.

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter2: Database Design Fundamentals
Section: Chapter Questions
Problem 11RQ
icon
Related questions
Question
The following relational database schema stores information about a restaurant. The primary
keys are underlined and field types are omitted. Study the schema and its corresponding
description to answer the questions
Customer (cid, cname, cage, caddress, cphone)
Table (tno, capacity, availability)
Item (iid, iname, price)
Order ( oid, cid, iid, tno, quantity)
Employee (eid, ename, eaddress, eage, salary)
Reservation (rid, eid, cid, date, time)
The customer is someone who eats in the restaurant. The Customer relation provides customer id,
the name, age, address and phone number information. The Table relation gives the restaurant's
occupancy information that includes the table number, the number of people who can sit on the
table, and the table's availability information. The restaurant serves several items. Each of the Items
has an identification number (e.g 82285), name (e.g, salad), and unit price (e.g.S15). Soon after
arrival in the restaurant a customer places an order. Order relation contains order id, customer id,
ordered items id, each item's quantity. Each order contains one or more items, and the quantity of
cach item (e.g., order 10 contains one soup and two salads). Here we are assuming that a customer
can visit the restaurant at most once in a day and can't place multiple orders at a time. Restaurant
employees serve customers. The Employee relation contains employee id, name, address, age, and
salary information. The customer can make a reservation in the restaurant beforehand. The
Reservation relation records reservation, employee, and customer ids, and reservation date and
time. In this question, you will only deal with querying part of SQL. You are NOT allowed to
tamper with (change the contents of) the database, i.e., CREATE, INSERT, DELETE ALTER,
UPDATE ete.
i.
Write a stored procedure to find the name of the employee which are highly paid and have
age greater than 30?
ii. Write a stored procedure to create a report that shows the employees who made the
reservation from "23d march 2021" till "Today" having number of reservations greater than
5.
Transcribed Image Text:The following relational database schema stores information about a restaurant. The primary keys are underlined and field types are omitted. Study the schema and its corresponding description to answer the questions Customer (cid, cname, cage, caddress, cphone) Table (tno, capacity, availability) Item (iid, iname, price) Order ( oid, cid, iid, tno, quantity) Employee (eid, ename, eaddress, eage, salary) Reservation (rid, eid, cid, date, time) The customer is someone who eats in the restaurant. The Customer relation provides customer id, the name, age, address and phone number information. The Table relation gives the restaurant's occupancy information that includes the table number, the number of people who can sit on the table, and the table's availability information. The restaurant serves several items. Each of the Items has an identification number (e.g 82285), name (e.g, salad), and unit price (e.g.S15). Soon after arrival in the restaurant a customer places an order. Order relation contains order id, customer id, ordered items id, each item's quantity. Each order contains one or more items, and the quantity of cach item (e.g., order 10 contains one soup and two salads). Here we are assuming that a customer can visit the restaurant at most once in a day and can't place multiple orders at a time. Restaurant employees serve customers. The Employee relation contains employee id, name, address, age, and salary information. The customer can make a reservation in the restaurant beforehand. The Reservation relation records reservation, employee, and customer ids, and reservation date and time. In this question, you will only deal with querying part of SQL. You are NOT allowed to tamper with (change the contents of) the database, i.e., CREATE, INSERT, DELETE ALTER, UPDATE ete. i. Write a stored procedure to find the name of the employee which are highly paid and have age greater than 30? ii. Write a stored procedure to create a report that shows the employees who made the reservation from "23d march 2021" till "Today" having number of reservations greater than 5.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Transaction Processing
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781305971776
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning