The document discusses relational algebra and its operations. It begins with an introduction to relational algebra, noting that it is a collection of operations performed on relations that result in another relation. It then discusses some examples of set operations like union, intersection, difference performed on sample tables. It also discusses unary operations like selection and projection, providing examples. It describes join operations that combine two tables. It concludes with discussing aggregate functions that can be applied to columns and rows.
Introduction to Relational algebra in DBMS - The relational algebra is explained with all the operations. Some of the examples from the textbook is also solved and explained.
Introduction to Relational algebra in DBMS - The relational algebra is explained with all the operations. Some of the examples from the textbook is also solved and explained.
These slides cover basic introduction to Relational Algebra which is a part of Relational Database Management System(RDBMS). The content includes basic RA symbols, operations with visualization.
In DBMS (DataBase Management System), the relation algebra is important term to further understand the queries in SQL (Structured Query Language) database system. In it just give up the overview of operators in DBMS two of one method relational algebra used and another name is relational calculus.
Score Week 5 Correlation and RegressionCorrelation and Regres.docxkenjordan97598
Score: Week 5 Correlation and RegressionCorrelation and RegressionCorrelation and Regression
<1 point> 1. Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)
a. Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?
b. Place table here (C8):b. Place table here (C8):b. Place table here (C8):
c. Using r = approximately .28 as the signicant r value (at p = 0.05) for a correlation between 50 values, what variables areUsing r = approximately .28 as the signicant r value (at p = 0.05) for a correlation between 50 values, what variables areUsing r = approximately .28 as the signicant r value (at p = 0.05) for a correlation between 50 values, what variables areUsing r = approximately .28 as the signicant r value (at p = 0.05) for a correlation between 50 values, what variables areUsing r = approxi.
These slides cover basic introduction to Relational Algebra which is a part of Relational Database Management System(RDBMS). The content includes basic RA symbols, operations with visualization.
In DBMS (DataBase Management System), the relation algebra is important term to further understand the queries in SQL (Structured Query Language) database system. In it just give up the overview of operators in DBMS two of one method relational algebra used and another name is relational calculus.
Score Week 5 Correlation and RegressionCorrelation and Regres.docxkenjordan97598
Score: Week 5 Correlation and RegressionCorrelation and RegressionCorrelation and Regression
<1 point> 1. Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)Create a correlation table for the variables in our data set. (Use analysis ToolPak or StatPlus:mac LE function Correlation.)
a. Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?Reviewing the data levels from week 1, what variables can be used in a Pearson's Correlation table (which is what Excel produces)?
b. Place table here (C8):b. Place table here (C8):b. Place table here (C8):
c. Using r = approximately .28 as the signicant r value (at p = 0.05) for a correlation between 50 values, what variables areUsing r = approximately .28 as the signicant r value (at p = 0.05) for a correlation between 50 values, what variables areUsing r = approximately .28 as the signicant r value (at p = 0.05) for a correlation between 50 values, what variables areUsing r = approximately .28 as the signicant r value (at p = 0.05) for a correlation between 50 values, what variables areUsing r = approxi.
Predicting US house prices using Multiple Linear Regression in RSotiris Baratsas
In this study, we attempted to formulate a Multiple Linear Regression model, to predict US house prices.
Steps involved:
Perform descriptive analysis and visualisation for each variable to get an initial insight of what the data looks like.
Conduct pairwise comparisons between the variables in the dataset to investigate if there are any associations implied by the dataset.
Construct a model for the expected selling prices according to the remaining features. Check whether this linear model fits well to the data.
Find the best model for predicting the selling prices and select the appropriate features using stepwise methods (used Forward, Backward and Stepwise procedures according to AIC or BIC to choose which variables appear to be more significant for predicting selling prices).
Get the summary of our final model, interpret the coefficients. Comment on the significance of each coefficient and write down the mathematical formulation of the model. Consider whether the intercept should be excluded from our model.
Check the assumptions of your final model. Are the assumptions satisfied? If not, what is the impact of the violation of the assumption not satisfied in terms of inference? What could someone do about it?
Conduct LASSO as a variable selection technique and compare the variables that we end up having using LASSO to the variables that you ended up having using stepwise methods.
This lecture talks about parsing. Briefly gives overview on lexicon, categorization, grammar rules, syntactic tree, word senses and various challenges of natural language processing
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
My slide relational algebra
1. Rushdi Shams, Dept of CSE, KUET 1
Database SystemsDatabase Systems
Relational AlgebraRelational Algebra
Version 1.0Version 1.0
2. 2Rushdi Shams, Dept of CSE, KUET
What is Relational AlgebraWhat is Relational Algebra
It is a collection of operations on relationsIt is a collection of operations on relations
If you apply relational algebra on some relations,If you apply relational algebra on some relations,
the result will be another relationthe result will be another relation
You can say a relation- a table.You can say a relation- a table.
So, operation on tables=another tableSo, operation on tables=another table
That is what relational algebra does!That is what relational algebra does!
3. 3Rushdi Shams, Dept of CSE, KUET
Memory RefreshmentMemory Refreshment
A relation is a set of attributes with values for eachA relation is a set of attributes with values for each
attribute such that:attribute such that:
Each attribute value must be a single value onlyEach attribute value must be a single value only
(atomic).(atomic).
All values for a given attribute must be of the same typeAll values for a given attribute must be of the same type
(or domain).(or domain).
Each attribute name must be unique.Each attribute name must be unique.
The order of attributes is insignificantThe order of attributes is insignificant
No two rows (tuples) in a relation can be identical.No two rows (tuples) in a relation can be identical.
The order of the rows (tuples) is insignificant.The order of the rows (tuples) is insignificant.
4. 4Rushdi Shams, Dept of CSE, KUET
2 types of operation2 types of operation
1.1. Set theory operations:Set theory operations:
Union, Intersection, Difference and CartesianUnion, Intersection, Difference and Cartesian
product.product.
2.2. Specific Relational Operations:Specific Relational Operations:
Selection, Projection, Join, DivisionSelection, Projection, Join, Division
We will take a look into set theory operations,We will take a look into set theory operations,
and then we will dig into specific relationaland then we will dig into specific relational
operationsoperations
5. 5Rushdi Shams, Dept of CSE, KUET
Our example tablesOur example tables
There are 2 tables- R andThere are 2 tables- R and
S, we will play withS, we will play with
them!!them!!
6. 6Rushdi Shams, Dept of CSE, KUET
UnionUnion
RUS means, a unionRUS means, a union
operation on R and Soperation on R and S
that will produce anotherthat will produce another
table which will have alltable which will have all
the rows of R and Sthe rows of R and S
except the duplicatesexcept the duplicates
There are 2 Sally in RThere are 2 Sally in R
and S, so, just take 1and S, so, just take 1
from themfrom them
7. 7Rushdi Shams, Dept of CSE, KUET
DifferenceDifference
R-S means, a differenceR-S means, a difference
operation on R and Soperation on R and S
that will produce anotherthat will produce another
table which will have alltable which will have all
the rows which is in Rthe rows which is in R
but not in S.but not in S.
As Sally is in R and in S,As Sally is in R and in S,
so, she has been omitted.so, she has been omitted.
8. 8Rushdi Shams, Dept of CSE, KUET
IntersectionIntersection
R∩S means, anR∩S means, an
intersection operation onintersection operation on
R and S that will produceR and S that will produce
another table which willanother table which will
have all the rows whichhave all the rows which
are in both R and S.are in both R and S.
As Sally is in R and in S,As Sally is in R and in S,
so, she has been selected.so, she has been selected.
12. 12Rushdi Shams, Dept of CSE, KUET
ConstraintsConstraints
You see tables, and start performing set theoryYou see tables, and start performing set theory
operations on them- MISTAKE!! You shouldoperations on them- MISTAKE!! You should
remember the following constraints before youremember the following constraints before you
perform set theory operations on tables.perform set theory operations on tables.
1.1. Attributes of relations needAttributes of relations need notnot be identical tobe identical to
perform union, intersection and differenceperform union, intersection and difference
operations.operations.
2.2. However, theyHowever, they must havemust have the same number ofthe same number of
attributes and the domains for correspondingattributes and the domains for corresponding
attributes must be identical.attributes must be identical.
13. 13Rushdi Shams, Dept of CSE, KUET
Other things to rememberOther things to remember
Union, Intersection and difference operatorsUnion, Intersection and difference operators
may only be applied to Union Compatiblemay only be applied to Union Compatible
relations.relations.
Union and Intersection are commutativeUnion and Intersection are commutative
operationsoperations
RUS= SURRUS= SUR
R∩S = S∩RR∩S = S∩R
Difference operation isDifference operation is NOTNOT commutative.commutative.
R - S not equal S - RR - S not equal S - R
14. 14Rushdi Shams, Dept of CSE, KUET
Class PerformanceClass Performance
Find out RUTFind out RUT
Find out R∩TFind out R∩T
Find out R-TFind out R-T
Find out T-RFind out T-R
15. 15Rushdi Shams, Dept of CSE, KUET
Cartesian ProductCartesian Product
It provides all the combinations of rows from two tables.It provides all the combinations of rows from two tables.
If A and B are 2 tables and A has 3 rows and B has 4 rows, then AIf A and B are 2 tables and A has 3 rows and B has 4 rows, then A×B is-×B is-
A1-B1A1-B1
A1-B2A1-B2
A1-B3A1-B3
A1-B4A1-B4
A2-B1A2-B1
A2-B2A2-B2
A2-B3A2-B3
A2-B4A2-B4
A3-B1A3-B1
A3-B2A3-B2
A3-B3A3-B3
A3-B4A3-B4
18. 18Rushdi Shams, Dept of CSE, KUET
SelectionSelection
Selection and Projection areSelection and Projection are unaryunary operators.operators.
The selection operator isThe selection operator is sigma (sigma (σσ))
The selection operation acts like a filter on aThe selection operation acts like a filter on a
relation byrelation by returning only a certain number ofreturning only a certain number of
rows.rows.
TheThe resulting relation will have the sameresulting relation will have the same
number of attributesnumber of attributes as the original relation.as the original relation.
19. 19Rushdi Shams, Dept of CSE, KUET
Selection (continued)Selection (continued)
The resulting relationThe resulting relation maymay have fewer rows thanhave fewer rows than
the original relation.the original relation.
The rows to be returned are dependent on aThe rows to be returned are dependent on a
condition that is part of the selection operator.condition that is part of the selection operator.
σσCC (R) Returns only those rows in R that satisfy(R) Returns only those rows in R that satisfy
conditioncondition CC
A condition C can be made up of anyA condition C can be made up of any
combination of comparison or logical operatorscombination of comparison or logical operators
that operate on the attributes of R.that operate on the attributes of R.
20. 20Rushdi Shams, Dept of CSE, KUET
Selection ExampleSelection Example
We have a table named EMP.We have a table named EMP.
We will play with this table named EMP for a while!We will play with this table named EMP for a while!
21. 21Rushdi Shams, Dept of CSE, KUET
Selection Example (continued)Selection Example (continued)
Select only those Employees in the CS departmentSelect only those Employees in the CS department
σσ Dept=‘CS’Dept=‘CS’ (EMP)(EMP)
22. 22Rushdi Shams, Dept of CSE, KUET
Selection Example (continued)Selection Example (continued)
Select only those Employees with last name Smith whoSelect only those Employees with last name Smith who
are assistant professorsare assistant professors
σσ Name=‘Smith’Name=‘Smith’ ΛΛ Rank=‘Assistant’Rank=‘Assistant’ (EMP)(EMP)
23. 23Rushdi Shams, Dept of CSE, KUET
Selection Example (continued)Selection Example (continued)
Select only those Employees who are either AssistantSelect only those Employees who are either Assistant
Professors or in the Economics departmentProfessors or in the Economics department
σσ Dept =‘Econ’V Rank=‘Assistant’Dept =‘Econ’V Rank=‘Assistant’ (EMP)(EMP)
24. 24Rushdi Shams, Dept of CSE, KUET
Selection Example (continued)Selection Example (continued)
Select only those Employees who are not in the CSSelect only those Employees who are not in the CS
department or Adjunctsdepartment or Adjuncts
σσ ¬¬(Dept=‘CS’ V Rank=‘Adjunct’)(Dept=‘CS’ V Rank=‘Adjunct’) (EMP)(EMP)
27. 27Rushdi Shams, Dept of CSE, KUET
ProjectionProjection
Projection is also aProjection is also a UnaryUnary operator.operator.
The Projection operator isThe Projection operator is pi (pi (ππ))
Projection limits the columns that will be returned from theProjection limits the columns that will be returned from the
original relation.original relation.
The general syntax is:The general syntax is: ππ attributesattributes RR
Where attributes is the list of attributes to be displayed and R isWhere attributes is the list of attributes to be displayed and R is
the relation.the relation.
The resulting table will have the same number of rows as theThe resulting table will have the same number of rows as the
original relation (unless there are duplicate rows produced).original relation (unless there are duplicate rows produced).
The number of columns of the resulting relation may be equal toThe number of columns of the resulting relation may be equal to
or less than that of the original relation.or less than that of the original relation.
28. 28Rushdi Shams, Dept of CSE, KUET
Projection ExampleProjection Example
Project only the names and departments of theProject only the names and departments of the
employeesemployees
ππ name,deptname,dept (EMP)(EMP)
29. 29Rushdi Shams, Dept of CSE, KUET
Combining selection &Combining selection &
projectionprojection
Show the names of all employees working in the CSShow the names of all employees working in the CS
departmentdepartment
ππ namename ((σσ Dept ='CS'Dept ='CS' (EMP) )(EMP) )
30. 30Rushdi Shams, Dept of CSE, KUET
Combining selection & projectionCombining selection & projection
(continued)(continued)
Show the name and rank of those Employees who areShow the name and rank of those Employees who are
not in the CS department or Adjunctsnot in the CS department or Adjuncts
ππ name, rankname, rank (( σσ ¬¬(Rank='Adjunct' V Dept='CS')(Rank='Adjunct' V Dept='CS') (EMP) )(EMP) )
33. 33Rushdi Shams, Dept of CSE, KUET
Aggregate FunctionsAggregate Functions
We can also apply Aggregate functions to columnsWe can also apply Aggregate functions to columns
and rowsand rows
1.1. SUMSUM
2.2. MINIMUMMINIMUM
3.3. MAXIMUMMAXIMUM
4.4. AVERAGE, MEAN, MEDIANAVERAGE, MEAN, MEDIAN
5.5. COUNTCOUNT
Aggregate functions are sometimes written using theAggregate functions are sometimes written using the
Projection operator or theProjection operator or the Tau character (Tau character (ττ))
34. 34Rushdi Shams, Dept of CSE, KUET
Aggregate Functions (continued)Aggregate Functions (continued)
Find the minimum SalaryFind the minimum Salary
ττ MIN(salary)MIN(salary) (EMP)(EMP)
Find the average SalaryFind the average Salary
ττ AVG(salaryAVG(salary) (EMP)) (EMP)
Count the number of employees in the CS departmentCount the number of employees in the CS department
ττ COUNT(name)COUNT(name) (( σσ Dept='CS'Dept='CS' (EMP) )(EMP) )
Find the total payroll for the Economics departmentFind the total payroll for the Economics department
ττ SUM(salary)SUM(salary) ((σσ Dept='Econ'Dept='Econ' (EMP) )(EMP) )
35. 35Rushdi Shams, Dept of CSE, KUET
JoinJoin
Join operations bring together two tables and combineJoin operations bring together two tables and combine
their rows and columns in a specific fashion.their rows and columns in a specific fashion.
The generic join operator called theThe generic join operator called the Theta JoinTheta Join isis
It takes as arguments the columns from the two tablesIt takes as arguments the columns from the two tables
that are to be joined.that are to be joined.
The join condition can beThe join condition can be
When the join condition operator is When the join condition operator is == then we call then we call
this an Equijointhis an Equijoin
Note that the columns in common are repeated.Note that the columns in common are repeated.
36. 36Rushdi Shams, Dept of CSE, KUET
Join (continued)Join (continued)
Now, we have two tables Emp and depart.Now, we have two tables Emp and depart.
We will play with these 2 tables for a while!We will play with these 2 tables for a while!
37. 37Rushdi Shams, Dept of CSE, KUET
Join (continued)Join (continued)
Find all information on every employee including theirFind all information on every employee including their
department infodepartment info
EMPEMP emp.Dept=depart.Deptemp.Dept=depart.Dept DEPARTDEPART
38. 38Rushdi Shams, Dept of CSE, KUET
Join (continued)Join (continued)
Take a look, one table has 5 rows, the other has 4 rows,Take a look, one table has 5 rows, the other has 4 rows,
the resultant has 5 rows!the resultant has 5 rows!
39. 39Rushdi Shams, Dept of CSE, KUET
Join (continued)Join (continued)
Find all information on every employee including departmentFind all information on every employee including department
info where the employee works in an office numbered less thaninfo where the employee works in an office numbered less than
the department main officethe department main office
EMPEMP (emp.office<depart.mainoffice)(emp.office<depart.mainoffice) ΛΛ (emp.dept =depart.dept)(emp.dept =depart.dept) DEPARTDEPART
40. 40Rushdi Shams, Dept of CSE, KUET
Natural JoinNatural Join
Notice in the generic (Theta) join operation, anyNotice in the generic (Theta) join operation, any
attributes in common (such as dept above) areattributes in common (such as dept above) are
repeated.repeated.
The Natural Join operation removes theseThe Natural Join operation removes these
duplicate attributes.duplicate attributes.
The natural join operator is:The natural join operator is: **
We can also assume usingWe can also assume using ** that the jointhat the join
condition will becondition will be == on the two attributes inon the two attributes in
common.common.
41. 41Rushdi Shams, Dept of CSE, KUET
Natural Join (continued)Natural Join (continued)
Emp * departEmp * depart
There are 2 Dept columns, one is omitted!There are 2 Dept columns, one is omitted!
42. 42Rushdi Shams, Dept of CSE, KUET
Outer JoinOuter Join
In the Join operations so far, only those tuples from bothIn the Join operations so far, only those tuples from both
relations that satisfy the join condition are included in therelations that satisfy the join condition are included in the
output relation.output relation.
The Outer join includes other rows as well according to a fewThe Outer join includes other rows as well according to a few
rules.rules.
Three types of outer joins:Three types of outer joins:
1.1. Left Outer Join includes all rows in the left hand relation andLeft Outer Join includes all rows in the left hand relation and
includes only those matching rows from the right hand relation.includes only those matching rows from the right hand relation.
2.2. Right Outer Join includes all rows in the right hand relationRight Outer Join includes all rows in the right hand relation
and includes only those matching rows from the left handand includes only those matching rows from the left hand
relation.relation.
3.3. Full Outer Join includes all rows in the left hand relation andFull Outer Join includes all rows in the left hand relation and
from the right hand relation.from the right hand relation.
43. 43Rushdi Shams, Dept of CSE, KUET
Outer Join (continued)Outer Join (continued)
Now we have another 2 tables.Now we have another 2 tables.
We will play with them for next few slides!We will play with them for next few slides!
44. 44Rushdi Shams, Dept of CSE, KUET
Left Outer JoinLeft Outer Join
PEOPLEPEOPLE people.food=menu.foodpeople.food=menu.food MENUMENU
45. 45Rushdi Shams, Dept of CSE, KUET
Right Outer JoinRight Outer Join
PEOPLEPEOPLE people.food=menu.foodpeople.food=menu.food MENUMENU
46. 46Rushdi Shams, Dept of CSE, KUET
Full Outer JoinFull Outer Join
PEOPLEPEOPLE people.food=menu.foodpeople.food=menu.food MENUMENU
47. 47Rushdi Shams, Dept of CSE, KUET
Outer UnionOuter Union
In this case, just go from row of table 1 to row of table 2.In this case, just go from row of table 1 to row of table 2.
Take common columns just once.Take common columns just once.
if matching criteria don’t match, then put NULL, else include inif matching criteria don’t match, then put NULL, else include in
the tablethe table
Repeat the same but this time go from row of table 2 to row ofRepeat the same but this time go from row of table 2 to row of
table 1table 1
48. 48Rushdi Shams, Dept of CSE, KUET
ReferencesReferences
Database Management Systems by Prof.Database Management Systems by Prof.
Holowczak, Zicklin School of Business,Holowczak, Zicklin School of Business,
Baruch College, City University of NewBaruch College, City University of New
YorkYork
Database Systems: Design, ImplementationDatabase Systems: Design, Implementation
& Management by Rob & Coronel, 6& Management by Rob & Coronel, 6thth
EditionEdition