Question 2
A) The AIT canteen wants you to write a script for them which would do the following
I) receive records from the user and keep these records into a file, the records must include
ID
Name of meal
Price of meal
Quantity bought today
Sales made for the day
2
Today the sales person wants to make seven entries into the file via the command line interface.
Your script should be able to find to present the sales person with the ability to
Search for a particular meal by ID
Search for a particular meal by name
find out how much money has been made from the sales of a particular
meal
list all records
list all meals and their prices
list a particular meal and its price
B) With a shell script explain how to use case
C) With code explain how the following work
if statements
if else statements
if elif else fi statements
D) Explain the difference between= grep -i "some string" some file and grep -iw "some string" some file
[
SHOW WARNINGS;
CREATE TABLE IF NOT EXISTS `receive_records` (
`id` INT NOT NULL,
`Name_of_meal` VARCHAR(45) NOT NULL,
`Price_of_meal` VARCHAR(45) NOT NULL,
`Quantity_bought_today` VARCHAR(45) NOT NULL,
`Sales_made_for_the_day` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;
select * from meal where meal.id=1;
select * from meal where name='abc';
Comments
Leave a comment