Sonali & Janata Bank
Post: Officer (IT), (Job id:10152)
Exam Date: 14.10.2023, Exam Take: BIBM
SELECT d.department_name, AVG(e.salary) AS average_salary
FROM employees e
JOIN department d ON e.department_id = d.department_id
WHERE e.salary > (SELECT AVG(salary) FROM employees)
GROUP BY d.department_name
HAVING COUNT(*) > 2
ORDER BY average_salary DESC;
SELECT d.department_name, AVG(e.salary) AS average_salary
This clause selects the department name and calculates the average salary of employees in each department.
FROM employees e
This clause specifies the employees table as the main data source and uses e as an alias.
JOIN department d ON e.department_id = d.department_id
This join links employees with their departments using the common department_id.
WHERE e.salary > (SELECT AVG(salary) FROM employees)
This condition filters employees whose salary is higher than the overall average salary of all employees.
GROUP BY d.department_name
This clause groups records by department name to calculate aggregate values.
HAVING COUNT(*) > 2
This condition ensures that only departments with more than two employees are included.
ORDER BY average_salary DESC
This clause sorts the result in descending order based on average salary.
SELECT d.department_name, AVG(e.salary) AS average_salary
এই clause department-এর নাম দেখায় এবং প্রতিটি department-এর employee-দের average salary হিসাব করে।
FROM employees e
এই clause employees table-কে data source হিসেবে ব্যবহার করে এবং e alias ব্যবহার করে।
JOIN department d ON e.department_id = d.department_id
এই JOIN clause department_id ব্যবহার করে employee-দের তাদের department-এর সাথে যুক্ত করে।
WHERE e.salary > (SELECT AVG(salary) FROM employees)
এই condition শুধুমাত্র সেই employee-দের নির্বাচন করে যাদের salary সব employee-এর overall average salary-এর চেয়ে বেশি।
GROUP BY d.department_name
এই clause department অনুযায়ী data group করে aggregate calculation করতে সাহায্য করে।
HAVING COUNT(*) > 2
এই clause নিশ্চিত করে যে শুধুমাত্র ২ জনের বেশি employee থাকা department গুলো result-এ আসবে।
ORDER BY average_salary DESC
এই clause average salary অনুযায়ী descending order-এ result সাজায়।
int F(n) {
if n == 0
return 0;
if n == 1
return 1;
return F(n-2)+F(n-1);
}
int main () {
result F(5);
}
The output of the program will be 5.
=====================
Code Analysis
- Function
F(n):- The function calculates the Fibonacci number for a given
nusing recursion. - Base Cases:
- If
n == 0, it returns 0. - If
n == 1, it returns 1.
- If
- Recursive Case:
- For other values of
n, it returnsF(n-2) + F(n-1).
- For other values of
- The function calculates the Fibonacci number for a given
- Main Function:
- The main function calls
F(5)and stores the result (though it should be assigned to a variable likeresult).
- The main function calls
Calculation of F(5)
The Fibonacci sequence calculated by the function is:
F(4) = F(3) + F(2)
F(3) = F(2) + F(1)
F(2) = F(1) + F(0)
Breaking it down:
F(2) = 1 (F(1) + F(0) = 1 + 0)
F(3) = 2 (F(2) + F(1) = 1 + 1)
F(4) = 3 (F(3) + F(2) = 2 + 1)
F(5) = 5 (F(4) + F(3) = 3 + 2)
1, 2, 2, 3, 3, 3, ……………………..100 (100times )
#include <iostream>
using namespace std;
int main() {
// Loop from 1 to 100
for (int n = 1; n <= 100; n++) {
// Inner loop to repeat 'n' exactly 'n' times
for (int i = 0; i < n; i++) {
cout << n << " ";
}
}
cout << endl; // Print a newline at the end of the sequence
return 0;
}
Preferred SDLC Model: Agile vs Waterfall
Between Agile and Waterfall SDLC models, Agile is generally preferred in modern software development because it is flexible, customer-focused, and adapts easily to changes.
Why Agile is Preferred over Waterfall
- Flexibility: Agile allows changes in requirements even at later stages, while Waterfall does not.
- Customer Involvement: Customers are involved throughout the development process in Agile.
- Early Delivery: Agile delivers working software in small iterations.
- Risk Reduction: Problems are identified early through continuous testing and feedback.
Example of Agile Model
Developing a mobile banking app is suitable for Agile because features like UI design, security, and payment options may change based on user feedback.
When Waterfall is Suitable
Waterfall is suitable when requirements are fixed and well-defined, such as developing payroll software for a government organization.
Preferred SDLC Model: Agile বনাম Waterfall
Agile ও Waterfall SDLC model-এর মধ্যে আধুনিক software development-এ সাধারণত Agile বেশি prefer করা হয়, কারণ এটি flexible এবং change-friendly।
Agile কেন Waterfall-এর চেয়ে ভালো
- Flexibility: Agile-এ development চলাকালীন requirement পরিবর্তন করা যায়, Waterfall-এ যায় না।
- Customer Involvement: Agile-এ customer পুরো development process-এ যুক্ত থাকে।
- Early Delivery: Agile ছোট ছোট iteration-এ working software দেয়।
- Risk Reduction: Continuous testing ও feedback-এর মাধ্যমে সমস্যা আগে ধরা পড়ে।
Agile Model-এর উদাহরণ
Mobile banking app development Agile-এর জন্য উপযুক্ত, কারণ user feedback অনুযায়ী feature ও design পরিবর্তন হতে পারে।
Waterfall কখন উপযুক্ত
Waterfall model উপযুক্ত যখন requirement আগে থেকেই সম্পূর্ণ নির্ধারিত থাকে, যেমন government payroll software development।
1. Difference between Guided and Unguided Transmission Media
| Aspect | Guided Media | Unguided Media |
|---|---|---|
| Definition | Data is transmitted through physical cables | Data is transmitted through air without cables |
| Transmission Path | Uses wired path | Uses wireless path |
| Interference | Low interference | High interference |
| Security | More secure | Less secure |
| Examples | Twisted pair, Co-axial cable, Fiber optics | Radio waves, Microwave, Satellite |
2. Difference between STP and UTP Cable
| Aspect | STP (Shielded Twisted Pair) | UTP (Unshielded Twisted Pair) |
|---|---|---|
| Shielding | Has metallic shielding | No shielding |
| Interference Protection | High protection from EMI | Less protection from EMI |
| Cost | More expensive | Cheaper |
| Installation | Difficult | Easy |
| Usage | Industrial environment | LAN and office networks |
3. Why UTP is Preferred over STP
- Low Cost: UTP cables are cheaper than STP cables.
- Easy Installation: UTP cables are lighter and flexible.
- Widely Available: Used in most LAN and Ethernet networks.
- Sufficient Performance: Provides good performance in normal office environments.
১. Guided ও Unguided Transmission Media-এর পার্থক্য
| বিষয় | Guided Media | Unguided Media |
|---|---|---|
| সংজ্ঞা | Physical cable ব্যবহার করে data পাঠানো হয় | Air বা space দিয়ে data পাঠানো হয় |
| Transmission Path | Wired মাধ্যম | Wireless মাধ্যম |
| Interference | কম | বেশি |
| Security | বেশি নিরাপদ | কম নিরাপদ |
| উদাহরণ | Twisted pair, Co-axial cable, Fiber optics | Radio wave, Microwave, Satellite |
২. STP ও UTP Cable-এর পার্থক্য
| বিষয় | STP (Shielded Twisted Pair) | UTP (Unshielded Twisted Pair) |
|---|---|---|
| Shielding | Metallic shielding থাকে | Shielding থাকে না |
| Interference Protection | EMI থেকে বেশি সুরক্ষা | EMI থেকে কম সুরক্ষা |
| খরচ | বেশি | কম |
| Installation | কঠিন | সহজ |
| ব্যবহার | Industrial environment | LAN ও office network |
৩. STP-এর তুলনায় UTP ব্যবহার করার সুবিধা
- কম খরচ: UTP cable তুলনামূলকভাবে সস্তা।
- সহজ Installation: UTP হালকা ও flexible হওয়ায় সহজে বসানো যায়।
- ব্যাপক ব্যবহার: অধিকাংশ Ethernet ও LAN network-এ ব্যবহৃত হয়।
- যথেষ্ট Performance: সাধারণ office environment-এর জন্য যথেষ্ট ভালো performance দেয়।






