Understanding Database Operations with Interactive Examples
Relational algebra is a procedural query language that provides a theoretical foundation for relational databases. It consists of operations that take one or two relations as input and produce a new relation as output.
রিলেশনাল অ্যালজেবরা হল একটি প্রসিডিউরাল কুয়েরি ভাষা যা রিলেশনাল ডেটাবেসের জন্য তাত্ত্বিক ভিত্তি প্রদান করে। এতে এমন অপারেশন রয়েছে যা এক বা দুটি রিলেশনকে ইনপুট হিসেবে নেয় এবং একটি নতুন রিলেশন আউটপুট হিসেবে তৈরি করে।
These are the basic operations in relational algebra:
Selects rows that satisfy a given condition
প্রদত্ত শর্ত পূরণ করে এমন সারিগুলি নির্বাচন করে
Selects specific columns from a relation
একটি রিলেশন থেকে নির্দিষ্ট কলাম নির্বাচন করে
Combines each row of one relation with each row of another
একটি রিলেশনের প্রতিটি সারিকে অন্য রিলেশনের প্রতিটি সারির সাথে সংযুক্ত করে
Combines rows from two relations, removing duplicates
দুটি রিলেশন থেকে সারি সংযুক্ত করে, ডুপ্লিকেট সরিয়ে
Finds rows in one relation but not in another
একটি রিলেশনে আছে কিন্তু অন্য রিলেশনে নেই এমন সারি খুঁজে বের করে
Combines related tuples from two relations
দুটি রিলেশন থেকে সম্পর্কিত টিপলগুলি সংযুক্ত করে
We'll use these sample tables to demonstrate relational algebra operations:
| ID | Name | Department | Salary |
|---|---|---|---|
| 101 | Alice | Sales | 50000 |
| 102 | Bob | IT | 60000 |
| 103 | Charlie | Sales | 55000 |
| 104 | Diana | HR | 45000 |
| DeptID | DeptName | Location |
|---|---|---|
| D1 | Sales | Floor 1 |
| D2 | IT | Floor 2 |
| D3 | HR | Floor 3 |
Click the buttons below to see different relational algebra operations in action:
| Result will appear here |
|---|
| Select an operation to see the result |
Select an operation from the buttons above to see how it works with example data.
Relational algebra operations have direct equivalents in SQL:
Relational Algebra: σDepartment='Sales'(Employees)
SQL: SELECT * FROM Employees WHERE Department = 'Sales'
রিলেশনাল অ্যালজেবরা: σDepartment='Sales'(Employees)
এসকিউএল: SELECT * FROM Employees WHERE Department = 'Sales'
Relational Algebra: πName, Salary(Employees)
SQL: SELECT Name, Salary FROM Employees
রিলেশনাল অ্যালজেবরা: πName, Salary(Employees)
এসকিউএল: SELECT Name, Salary FROM Employees
Relational Algebra: Employees ⋈Employees.Department = Departments.DeptName Departments
SQL: SELECT * FROM Employees JOIN Departments ON Employees.Department = Departments.DeptName
রিলেশনাল অ্যালজেবরা: Employees ⋈Employees.Department = Departments.DeptName Departments
এসকিউএল: SELECT * FROM Employees JOIN Departments ON Employees.Department = Departments.DeptName