Overview Data warehouse is widely used today for data storage, retrieval and ana
ID: 3735348 • Letter: O
Question
Overview Data warehouse is widely used today for data storage, retrieval and analysis in many applications Retailers Services Education Applications of Data Warehouses and Distribution Banking/ Finance Insurance Data Warehouse Application Examples In this project, you are required to write a shell seript to create, edit and view a data warchouse that contains car rental records. The shell script has to be written in Bourne shell syntax i.e. bash). You may use any bash feature or Linux command available, but cannot use any high-level programming languages such as C++, Java, C#. The first parameter for your script is always the data warehouse name being queried. The second parameter is always the command that will be executed. Any parameters that follow are specific to the command that was issued.Explanation / Answer
To Display and edit the records from a file:-
#!/bin/bash
echo " Please provide information e: edit file, d: display the file"
echo " Please provide the file name"
INFO=$1
FILENAME=$2
case $INFO in
-e)
echo "Editing $2 file..."
[ -z $FILENAME ] && { echo "File name missing"; exit 1; } || vi $FILENAME
;;
-d)
echo "Displaying $2 file..."
[ -z $FILENAME ] && { echo "File name missing"; exit 1; } || cat $FILENAME
;;
*)
echo "Please provide Valid option!"
echo " Please provide information e: edit file, d: display the file"
echo " Please provide the file name"
;;
esac
To create new datawarehouse:-
#!/bin/bash
echo "Welcome to Car Rental Sevices"
echo " Please choose the vehicle you want to rent out: "
echo "Please provide 1 option:- car, truck, jeep, bicycle, scooter"
if [ -z $1 ]
then
vehicle=" NOT VALID "
elif [ -n $1 ]
then
vehicle=$1
fi
case $vehicle in
"car") echo " $vehicle rental is Rs.20 per k/m.";;
"truck") echo " $vehicle rental is Rs.30 per k/m.";;
"jeep") echo " $vehicle rental is Rs.50 per k/m.";;
"bicycle") echo " $vehicle rental Rs.2 per k/m.";;
"scooter") echo "$vehicle rental Rs.10 per k/m.";;
*) echo "Sorry!!! No Services available for $vehicle rental!";;
esacll
touch FILENAME; //created for new record.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.