js

Monday, July 21, 2025

Explain RANK() in PostgreSQL

RANK() in PostgreSQL

The RANK() function in PostgreSQL assigns a rank to each row within a partition of a result set. It’s part of window functions.


✅ Basic Syntax:

SELECT column1, column2, RANK() OVER (ORDER BY columnX DESC) AS rank
FROM table_name;

 

✅ Example:

Sample Table: sales

idnameamount
1Alice500
2Bob700
3Carol700
4David300

SELECT name, amount,
       RANK() OVER (ORDER BY amount DESC) AS rank
FROM sales;

✅ Output:
name    amount    rank
Bob    700    1
Carol    700    1
Alice    500    3
David    300    4

✅ Ranks are shared → same amount → same rank → skips numbers (1, 1, 3, 4).
✅ Difference Between RANK() and DENSE_RANK()
Function    Behavior
RANK()    Skips ranks if there are ties.
DENSE_RANK()    Does not skip ranks; ranks are dense.
✅ Example with DENSE_RANK():

SELECT name, amount,
       DENSE_RANK() OVER (ORDER BY amount DESC) AS rank
FROM sales;

name    amount    rank
Bob    700    1
Carol    700    1
Alice    500    2
David    300    3
✅ ✅ Summary:

    RANK() → skips rank numbers if tied.

    DENSE_RANK() → no gaps in ranking.

    You can partition by category using:

RANK() OVER (PARTITION BY department ORDER BY amount DESC)


What is Table Partitioning in PostgreSQL (psql)?

 

✅ What is Table Partitioning in PostgreSQL (psql)?

Table Partitioning in PostgreSQL is a way to divide a large table into smaller, more manageable pieces (called partitions), while still querying them as a single table.
It helps improve performance, especially for big datasets, by making queries faster and maintenance easier.


✅ Types of Partitioning in PostgreSQL:

TypeDescription
Range PartitioningDivides data based on ranges (e.g., date ranges).
List PartitioningDivides data based on a list of values (e.g., category names).
Hash PartitioningUses a hash function to distribute data across partitions.
 

How to Manually Create Partition Tables in PostgreSQL

In PostgreSQL, you must create partitions manually after creating the parent table (unlike some databases with automatic partition creation).


✅ Step-by-Step Guide:

✅ 1. Create Parent (Main) Table


Sunday, July 20, 2025

HSLC EXAM 2026 দশম শ্ৰেণীৰ Science বিজ্ঞান 100 % Common MCQ

 HSLC EXAM 2026 দশম শ্ৰেণীৰ Science বিজ্ঞান 100 % Common MCQ 


1. মেন্ডেলিভে প্রস্তুত কৰা পর্যাবৃত্ত তালিকাত মৌলবোৰ সজোৱা হৈছিল
The elements were arranged in the periodic table prepared by Mendeleev -
(A) পাৰমাণবিক বৰ্দ্ধিত অধঃক্ৰমত
In increasing descending order of atomic mass
(B) পাৰমাণবিক ভৰৰ বৰ্দ্ধিত ক্ৰমত 
In increasing order of atomic mass
(C) পাৰমাণবিক সংখ্যাৰ অধঃক্রমত 
In descending order of atomic number
(D) পাৰমাণবিক সংখ্যাৰ ঊর্ধ্বক্ৰমত 
In ascending order of atomic number


Answer: (B) In increasing order of atomic mass

2. তলৰ কোনটো দ্বিতীয় পৰ্যায়ৰ মৌল নহয়?
Which of the following is not a secondary element?
(a) F / Fluorine
(b) C / Carbon
(c) Li / Lithium
(a) Ca / Calcium

Answer: D

দ্বিতীয় পৰ্যায়ৰ মৌলকেইটা হৈছে Li, Be, B, C, N, O, F আৰু Ne (neon)
The second phase elements are Li, Be, B, C, N, O, F and Ne

3.  ____________ ৰ যোজক ইলেক্ট্ৰণৰ সংখ্যা সৰ্বাধিক।
has the highest number of valence electrons.
(a) Al
(b) P / Phosphorus
(c) Si / Silicon
(d) Na / Sodium

Answer: B)
Al, P, Si আৰু Naৰ যোতকি ইলেক্ট্রনৰ সংখ্যা ক্রমে 3, 5, 4 আৰু 1
The number of valence electrons of Al, P, Si and Na is 3, 5, 4 and 1 respectively

4. নিশ্চয়োক্তি (A): একে বৰ্গৰ মৌলবোৰে একেধৰণৰ ৰাসায়নিক ধৰ্ম প্ৰদৰ্শন কৰে।
Assertion (A): Elements of the same class exhibit the same chemical properties
কাৰণ (R): একে বৰ্গৰ মৌলবোৰৰ যোজক ইলেক্ট্ৰ'নৰ সংখ্যা ভিন ভিন.
Reason (R): Elements of the same class have different numbers of valence electrons
(A) A আৰু R উভয়ে সত্য আৰু R হৈছে A ৰ শুদ্ধ ব্যাখ্যা / Both A and R are true and R is the correct interpretation of A
(B) A আৰু R উভয়ে সত্য কিন্তু R, Aৰ শুদ্ধ ব্যাখ্যা নহয় / Both A and R are true but R is not the correct interpretation of A
(C) A সত্য কিন্তু R অসত্য। / A is true but R is false.
(D) A অসত্য, কিন্তু R সত্য। / A is false, but R is true.
(E) A আৰু R. উভয়ে অসত্য / Both A and R. are false

Answer: C

5. নিশ্চয়োক্তি (A): বৰ্গ 16 ৰ মৌলবোৰ একযোজী।
Assertion (A): The elements of square 16 are monotonic.
কাৰণ (R): বৰ্গ 16 ৰ মৌলবোৰৰ যোজক কক্ষত 7 টা ইলেক্ট্রন থাকে।
Reason (R): Group 16 elements have 7 electrons in their valence orbitals.
(A) A আৰু R উভয়ে সত্য আৰু R হৈছে A ৰ শুদ্ধ ব্যাখ্যা / Both A and R are true and R is the correct interpretation of A
(B) A আৰু R উভয়ে সত্য কিন্তু R, Aৰ শুদ্ধ ব্যাখ্যা নহয় / Both A and R are true butR is not the correct interpretation of A
(C) A সত্য কিন্তু R অসত্য। / A is true but R is false.
(D) A অসত্য, কিন্তু R সত্য। / A is false, but R is true.
(E) A আৰু R. উভয়ে অসত্য / Both A and R. are false

Answer: E

7. নিশ্চয়োক্তি (A): সালোক সংশ্লেষণৰ বাবে আবশ্যকীয় উপাদানকেইটা হৈছে কার্বন ডাই-অক্সাইড,
পানী আৰু খনিজ পদার্থ।
Assertion (A): The components required for photosynthesis are carbon dioxide, water and minerals.
(R): পোষক দ্রব্যই এটা জীবক শক্তি যোগায়।
Reason (R): Nutrients provide energy to an organism energy to an organ
(A) Both A and R are true and R is the correct interpretation of A
A আৰু R উভয়ে সত্য আৰু R হৈছে A ৰ শুদ্ধ ব্যাখ্যা
(B) Both A and R are true but R is not the correct interpretation of A
A আৰু R উভয়ে সত্য কিন্তু R, Aৰ শুদ্ধ ব্যাখ্যা নহয়
(C) A is true but R is false.
(D) A is false, but R is true.
(E) Both A and R. are false

Answer: B

8. নিশ্চয়োক্তি (A): সেউজীয়া উদ্ভিদসমূহত স্বপোষীয় পৰিপুষ্টি সাধন হয়।
Assertion (A): Green plants provide self-nutrition.
কাৰণ (R): সেউজীয়া উদ্ভিদে নিজৰ খাদ্য নিজে প্ৰস্তুত কৰে।
Reason (R): Green plants prepare their own food.
(A) A আৰু R উভয়ে সত্য আৰু R হৈছে A ৰ শুদ্ধ ব্যাখ্যা
(B) A আৰু R উভয়ে সত্য কিন্তু R, Aৰ শুদ্ধ ব্যাখ্যা নহয়
(C) A সত্য কিন্তু R অসত্য।
(D) A অসত্য, কিন্তু R সত্য।
(E) A আৰু R. উভয়ে অসত্য

Answer: A

9.নিশ্চয়োক্তি (A): এমিবা এবিধ সর্বভক্ষী প্রাণী।
Assertion (A): Amoebae are omnivores
কাৰণ (R): সিংহ এবিধ মাংসভোজী প্রাণী
Reason (R): The lion is a carnivore
(A) A আৰু R উভয়ে সত্য আৰু R হৈছে A ৰ শুদ্ধ ব্যাখ্যা
(B) A আৰু R উভয়ে সত্য কিন্তু R, Aৰ শুদ্ধ ব্যাখ্যা নহয়
(C) A সত্য কিন্তু R অসত্য।
(D) A অসত্য, কিন্তু R সত্য।
(E) A আৰু R. উভয়ে অসত্য

Answer: B

10. নিশ্চয়োক্তি (A): যকৃত হৈছে দেহৰ ক্ষুদ্রতম গ্রন্থি। 
Assertion (A): The liver is the smallest gland in the body.
কোৱা (R): ই লালটি এমাইলেজ নিঃসৰণ কৰে।
Reason (R): It secretes red amylase
(A) A আৰু R উভয়ে সত্য আৰু R হৈছে A ৰ শুদ্ধ ব্যাখ্যা
(B) A আৰু R উভয়ে সত্য কিন্তু R, Aৰ শুদ্ধ ব্যাখ্যা নহয়
(C) A সত্য কিন্তু R অসত্য।
(D) A অসত্য, কিন্তু R সত্য।
(E) A আৰু R. উভয়ে অসত্য

Answer: E

11.মৌলৰ পর্যাবৃত্ত তালিকাৰ পৰ্যায় এটাত বাওঁফালৰ পৰা সোঁফাললৈ পাৰমাণবিক ব্যাসার্ধ ক্রমান্বয়ে-
At a stage in the periodic table of elements, the atomic radius from left to right is gradually
(a) বাঢ়ে increases
(b) কমে decreases
(c) একেই থাকে remains the same
(d) ওপৰৰ এটাও নহয়। none of the above.

Answer: B

12. এটা পৰমাণুৰ ইলেকট্ৰনীয় বিন্যাস হ'ল 2, 8, 7। তলৰ মৌলবোৰৰ কোনটোৰ সৈতে ইয়াব ৰাসায়নিক সাদৃশ্য থাকিব? (বন্ধনিৰ ভিতৰত পাৰমাণৱিক সংখ্যাবোৰ দিয়া হৈছে।
The electronic configuration of an atom is 2, 8, 7 Which of the following elements would lab be chemically similar to? (Atomic numbers are given in parentheses.
(a) N (7)
(b) F (9)
(c) P(15)
(d) Ar (18)

Answer: B

13. Element X forms the chloride of the symbol XCI2. It is a solid with a high melting point. Element X is most likely to be in the same class as which of the following?
মৌল X য়ে XCI₂ সংকেতৰ ক্ল'ৰাইড গঠন কৰে। ই উচ্চ গলনাংকযুক্ত এটা গোটা পদার্থ। মৌল X তলৰ কোনটোৰ সৈতে একেটা বৰ্গত থকাৰ সম্ভাৱনা সবাতোকৈ বেছি?
(a) Na
(b) Mg
(c) Al
(d) Si

Answer: B

14. মেন্ডেলিভৰ পৰ্যাবৃত্ত তালিকা ব্যৱহাৰ কৰি নিৰ্ণয় কৰা "K" মৌলৰ অক্সাইডটোৰ সংকেত হ'ল
The symbol for the oxide of element 'K' determined using Mendeleev's periodic table is
(a) KO2
(b) K₂O
(c) K2O3
(d) K2O2

Answer: B

15. তলৰ কোনটো ধাতুকল্প?
Which of the following is a synonym?
(a) এলুমিনিয়াম Aluminum
(b) লিথিয়াম Lithium
(c) ছিলিকন Silicon
(d) ছ'ডিয়াম Sodium

Answer: C

16. তলত কোনটো ধাতুও নহয়, অধাতুও নহয়?
Which of the following is neither a metal nor a non-metal?
(a) ব্র'মিন / Bromine
(b) ব'ৰ'ন / Boron
(c) বিছমুথ / Bismuth
(d) বেৰিলিয়াম / Beryllium

Answer: B

17. তলত দিয়া মৌলবােৰৰ কোনটো নিয়ন গেছৰ ওচৰত?
Which of the following elements is closest to neon gas?
(a) O
(b) N
(c) Cl / Chlorine
(d) F / Fluorine

Answer: D

18. তৃতীয় পৰ্যায়ৰ মৌলৰ সংখ্যা-
Number of elements of the third stage-
(a) 18
(b) 16
(c) 8
(d) 10

Answer: C

19. এটা পৰমাণুৰ ইলেক্ট্রনীয় বিন্যাস হ'ল 2, 8, 7 এই মৌলটোৰ পাৰমাণবিক সংখ্যা কি?
The electronic configuration of an atom is 2, 8, 7. What is the atomic number of this element?
A) 17
B) 16
C) 19
D) 21

Answer: A

20. এটা মৌলৰ পৰমাণুৰ ইলেকট্ৰনীয় বিন্যাস হ'ল 2. 8. 1. মৌলটোৰ পাৰমাণবিক সংখ্যা কিমান.
The electronic configuration of an atom of an element is 2. 8. 1. What is the atomic number of the element
A) 2
B) 1
C) 8
D) 11

Answer: D

What is Single Sign-On (SSO)?

 

✅ What is Single Sign-On (SSO)?

Single Sign-On (SSO) is an authentication process that allows a user to log in once and gain access to multiple applications or systems without having to log in again for each of them.

👉 Example:

  • You log into your Google account, and you automatically get access to Gmail, YouTube, Google Drive, Google Docs, etc., without signing in separately for each service.


✅ How SSO Works — Step by Step:

StepDescription
1️⃣ User Login RequestThe user visits an application (called the Service Provider, e.g., Gmail) and tries to log in.
2️⃣ Redirect to Identity Provider (IdP)The application redirects the user to an Identity Provider (IdP) (e.g., Google Identity, Okta, Azure AD) to authenticate.
3️⃣ AuthenticationThe user enters login credentials only once at the Identity Provider.
4️⃣ Token/Session CreationIf the credentials are correct, the IdP creates a secure token (like SAML, OAuth, or OpenID Connect token).
5️⃣ Redirect BackThe user is redirected back to the application with the token.
6️⃣ Access GrantedThe application validates the token, and the user gets access. Now the user can access other related applications without logging in again.

✅ SSO Common Terms:

  • Identity Provider (IdP): Authenticates user identity (e.g., Okta, Google).

  • Service Provider (SP): The application the user wants to access (e.g., Gmail, Salesforce).

  • Token: A digitally signed document verifying user identity (SAML, OAuth, JWT).


✅ Benefits of SSO:

  • ✔️ One Login for multiple services

  • ✔️ Better user experience

  • ✔️ Reduced password fatigue

  • ✔️ Stronger security controls at one central point

  • ✔️ Easier IT management


✅ Disadvantages of SSO:

  • If SSO is compromised, all connected services are at risk.

  • Initial setup can be complex.

  • Dependency on Identity Provider availability.


✅ Common SSO Protocols:

  • SAML (Security Assertion Markup Language) → Popular in Enterprises

  • OAuth 2.0 → Used by apps like Google, Facebook

  • OpenID Connect → Built on top of OAuth 2.0 for identity verification




ASSAM HSLC 2024 Social science Common Question Answer. Social Science Geography Chapter 2 Class 10.

 ASSAM HSLC 2024 Social science Common Question Answer. Social Science Geography Chapter 2 Class 10.

(১) সেউজ গৃহ গেছবোৰৰ ভিতৰত তলৰ কোনবিধ গেছ, গোলকীয় উত্তাপ বৃদ্ধিৰ বাবে দায়ী?
(ক) কার্বন ডাই অক্সাইড
(খ) আর্গন
উত্তৰঃ কার্বন ডাই অক্সাইড

(২) বায়ুমণ্ডল ভূ-পৃষ্ঠৰপৰা প্ৰায় কিমান কিলো'মিটাৰ উচ্চতালৈ বিয়পি আছে?
(ক) 480 কিলো'মিটাৰ
(খ) 280 কিলো'মিটাৰ
উত্তৰঃ 480 কিলো'মিটাৰ

(৩) স্থলমণ্ডলে ভূ-পৃষ্ঠৰ প্ৰায় কিমান শতাংশ আগুৰি আছে?
(ক) 29 শতাংশ।
(খ) 60 শতাংশ
উত্তৰঃ 29 শতাংশ

(৪) গেছবোৰৰ ভিতৰত কোনটো গোলকীয় উত্তাপ, বৃদ্ধিৰ বাবে দায়ী নহয়?
(ক) অ'জন
(খ) মিথেন
উত্তৰঃ অ'জন

(৫) বননি ধবংস কাৰ্য্যক কি বুলি কোৱা হয়?
(ক) নিৰ্বনীকৰণ
(খ) উদ্ভিদকৰণ
উত্তৰঃ নিৰ্বনীকৰণ

(৬) বায়ু প্ৰদূষণৰ লগত জড়িত এটা প্রধান সমস্যা কি?
(ক) নাইট্রজেন ডাইঅক্সাইড
(খ) এচিড বৰষুণ
উত্তৰঃ এচিড বৰষুণ

(৭) প্রখ্যাত ভূগোল-বিজ্ঞানী স্থল, জল, বায়ু আৰু জীৱৰ মাজৰ পাৰস্পৰিক সম্পৰ্কৰ পৰিণতিকে পৰিবেশ বুলি কৈছে?
(ক) জর্জ ছিজহ'ম
(খ) পিটাৰ হেগেটে
উত্তৰঃ পিটাৰ হেগেটে

(৮) স্বাভাৱিক অৱস্থাত বায়ুমণ্ডলত কিমান শতাংশ নাইট্ৰ'জেন গেছ থাকে?
(ক) ৭৮.০৮ শতাংশ
(খ) ৮৮.০৮ শতাংশ
উত্তৰঃ ৭৮.০৮ শতাংশ

(৯) জীৱ মণ্ডলত এতিয়ালৈকে চিনাক্ত কৰা উদ্ভিদ আৰু প্ৰাণীৰ প্ৰজাতিৰ সংখ্যা?
(ক) ১.৭৫ নিযুত
(খ) ৩.৭৫ নিযুত
উত্তৰ ১.৭৫ নিযুত

(১০) বায়ুমণ্ডলত সেউজগৃহ গেছৰ পৰিমান কিমান?
(ক) ০.২ শতাংশ
(খ) ০.১ শতাংশ
উত্তৰ ০.১ শতাংশ

(১১) গোলকীয় উষ্ণতা বৃদ্ধিত আটাইতকৈ বেছি অৰিহণা যোগোৱা গেছটো কি?
(ক) নাইট্রাছ অক্সাইড
(খ) কার্বন ডাইঅক্সাইড
উত্তৰ কার্বন ডাইঅক্সাইড

(১২) এছিড বৰষুণ সাধাৰণতে সৃষ্টি কি অঞ্চলত হয়?
(ক) অৰণ্য অঞ্চলত
(খ) ঔদ্যোগিক অঞ্চলত
উত্তৰ ঔদ্যোগিক অঞ্চলত

(১৩) বায়ুমণ্ডলত কাৰ্বন-ডাই-অক্সাইডৰ পৰিমাণ কিমান?
(ক) ০.০৩৫%
(খ) ৩.৩৫%
উত্তৰ ০.০৩৫%

(১৪) জলমণ্ডলে ভূ-পৃষ্ঠৰ কিমান শতাংশ আগুৰি আছে?
(ক) 29 শতাংশ
(খ) 71 শতাংশ
উত্তৰ 71 শতাংশ

Explain RANK() in PostgreSQL

✅ RANK() in PostgreSQL The RANK() function in PostgreSQL assigns a rank to each row within a partition of a result set. It’s part of wind...