This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -r -d '' aliases << EOM | |
alias dps="docker ps" | |
alias dcu="docker compose up -d" | |
alias dcd="docker compose down" | |
alias dcf="docker compose up -d --force-recreate" | |
alias dcl="docker compose logs -f" | |
alias dcp="docker compose pull" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
AIM: | |
Given Student Report Database, in which student marks assessment is recorded. In such schema, create a trigger so that the total and average of specified marks is automatically inserted whenever a record is inserted. | |
Student | |
Sid name Subj1 Subj2 Subj3 Total Avg | |
*/ | |
DELIMITER // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
AIM: | |
Create a trigger to print the following messages when insert, delete or update operation is performed on students table mentioned in the previous experiment for each tuple that is inserted, deleted or updated. Assume that semester grades of s1 and s2 are stored in students table along with Roll number and name of students | |
Operation Action/Message | |
if name of student is updated updated to sname (sname is the revised name of the | |
particular student) | |
roll, grd_s1 or grd_s2 is updated inserting sname(sname is the entered name of the | |
particular student) | |
if a row/tuple is deleted deleting sname(sname is the name of the deleted student) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
AIM: | |
Create a cursor that stores the details of students eligible for honours in roll number order. Assume that semester grades of s1 and s2 are stored in students table along with Roll number and name of students. A student is eligible for honors if the total grade for s1 and s2 is greater than 12. Print the highest grade obtained in the previous semesters for honors students using the cursor created. | |
*/ | |
-- Create the table to store the student details. | |
CREATE TABLE students ( | |
roll_number NUMBER, | |
name VARCHAR2(20), | |
s1 NUMBER, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
AIM: | |
Write a PL/SQL program using cursor to print the electricity bill of the consumer (refer unit-charge table given below) | |
Unit consumed charge | |
1 100 5 | |
101-300 7.5 | |
301-500 15 | |
>500 22.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
AIM: | |
Create a pl/sql block for creating a function dc that determines the category/type of customer after verifying their account balance. The following are the categories category platinum(for account balance greater than 50k) , gold (account balance less than or equal to 50k but greater than 10k) ,silver(for account balance less than or equal to 10k). Assume necessary attributes in customer. Write a query to retrieve the details of customers along with customer category(using the created function dc) | |
*/ | |
-- Create the function dc to determine the customer category | |
CREATE OR REPLACE FUNCTION dc(balance NUMBER) | |
RETURN VARCHAR2 IS | |
category VARCHAR2(20); | |
BEGIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
AIM: | |
Write a pl/sql block to find average mark of students in a class and print the marks;Print a message " Need improvement " if the class average is less than 40. At the bottom print today's date and day of the week (monday, tuesday etc.) | |
*/ | |
DECLARE | |
-- Declare variables to store class average and student marks. | |
class_average NUMBER := 0; | |
total_students NUMBER := 0; | |
student_average NUMBER := 0; |