This document discusses relational database management systems and SQL. It covers basic SQL queries involving selection, projection, and joins. It also discusses set operations in SQL like union, intersect, and except. Further, it describes complex queries, integrity constraints, domains, and data definition language commands for creating, altering, and dropping tables.
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...Raj vardhan
The Relational Data Model and Relational Database Constraints
Ch5 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Example of STUDENT Relation(figure 5.1)
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...Raj vardhan
The Relational Data Model and Relational Database Constraints
Ch5 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Example of STUDENT Relation(figure 5.1)
Relational database intro for marketersSteve Finlay
If you work in marketing and product management, you depend heavily on relational databases, even if you are not aware of them. This short presentation explains the most important things you need to know about why they are necessary, and how they work.
Relational database intro for marketersSteve Finlay
If you work in marketing and product management, you depend heavily on relational databases, even if you are not aware of them. This short presentation explains the most important things you need to know about why they are necessary, and how they work.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
RDBMS
1. Relational Database Management System
Nadar Saraswathi College of Arts & Science
Submitted by
N. Nagapandiyammal
M. Sc (CS)
2. Content
• Basic Structure
• Set Operations
• Complex Queries
• Joined Relations
• Data-Definition Language(DDL)
3. Basic Structure
SQL is based on set and relational operations with certain
modifications and enhancements
A typical SQL query has the form
select A1,A2, ..., An
From r1,r2, ..., rm
Where P
A is represent attributes
r is represent relations
P is a predicate
This query is equivalent to the relational algebra expression:
ΠA1,A2, ..., An(P(r1 x r2 x...x rm))
The result of an SQL query is a relation.
4. Set Operations
The set operations union, intersect, and except operate on
relations and correspond to the relational algebra operations
[,, and −.
Each of the above operations automatically eliminates
duplicates; to retain all duplicates use the corresponding
multiset versions union all, intersect all and except all.
Suppose a tuple occurs m times in r and n times in s, then, it
occurs:
m + n times in r union all s
min(m, n) times in r intersect all s
max(0,m−n) times in r except all s
5. Find all customers who have a loan, an account, or both:
(Select customer-name from depositor)
union
(select customer-name from borrower)
Find all customers who have both a loan and an account
(select customer- name from depositor)
intersect
(select customer-name from borrower)
Find all customers who have an account but no loan.
(select customer-name from depositor)
except
(select customer-name from borrower)
6. Complex Queries
• Complex queries are often hard or impossible to write as a
single SQL block or a union / intersection / difference of
SQL blocks.
• Following are some very important Complex SQL Queries
Examples with answers. I have tried to explain each and
every query in detail so that everyone will get idea of how it
is executed step-by-step. Following are some Complex SQL
Queries Examples with answers in detail.
7. 1.Query to find Second Highest Salary of Employee?
Answer:
Select distinct Salary from Employee e1
where 2=Select count(distinct Salary) from
Employee e2 where e1.salary<=e2.salary;
2.Query to find duplicate rows in table?
Answer:
Select * from Employee a where rowid <>( select
max(rowid) from Employee b where
a.Employee_num=b.Employee_num);
8. Joined Relations
o Join operations take two relations and return as a result another
relation.
o These additional operations are typically used as sub query
expressions in the from clause.
o Join condition – defines which tuple in the two relations match, and
what attributes are present in the result of the join.
o Join type – defines how tuple in each relation that do not match any
tuple in the other relation (based on the join condition) are treated.
Join Types
inner join
left outer join
right outer join
full outer join
Join Conditions
natural
on <predicate>
using (A1, A2, . . .,
An)
9. Joined Relations – Datasets for Examples
Relation loan
Relation borrower
branch-name loan-number amount
Downtown L-170 3000
Redwood L-230 4000
Perry ridge L-260 1700
customer-name loan-number
Jones L-170
Smith L-230
Hayes L-260
10. Joined Relations – Examples
loan inner join borrower on
loan. loan-number =borrower. loan-number
loan left outer join borrower on
loan. loan-number=borrower. loan-number
loan natural inner join borrower
loan natural right outer join borrower
loan full outer join borrower using (loan-number)
Find all customers who have either an account or a loan (but
not both) at the bank.
select customer-name
from (depositor natural full outer join borrower)
where account-number is null or loan-number is null
11. Data Definition Language (DDL)
Allows the specification of not only a set of relations but
also information about each relation, including:
The schema for each relation.
The domain of values associated with each attribute.
Integrity constraints.
The set of indices to be maintained for each relation.
Security and authorization information for each relation.
The physical storage structure of each relation on disk.
12. Domain Types in SQL
char(n). Fixed length character string, with user-
specified length n.
varchar(n). Variable length character strings, with user-
specified maximum length n.
int. Integer (a finite subset of the integers that is
machine-dependent).
smallint. Small integer (a machine-dependent subset of
the integer domain type).
numeric( p, d). Fixed point number, with user-specified
precision of p digits, with n digits to the right of decimal
point.
13. Domain Types in SQL (Cont.)
• real, double precision. Floating point and double-
precision floating point numbers, with machine-dependent
precision.
• float(n). Floating point number, with user-specified
precision of at least n digits.
• date. Dates, containing a (4 digit) year, month and date.
• time. Time of day, in hours, minutes and seconds.
– Null values are allowed in all the domain types. Declaring
an attribute to be not null prohibits null values for that
attribute.
– create domain construct in SQL-92 creates user-defined
domain types
create domain person-name char(20) not null
14. Create Table Construct
• An SQL relation is defined using the create table
command:
create table r (A1 D1, A2 D2, . . . , An Dn,
<integrity-constraint l >,
. . .,
<integrity-constraint>)
– r is the name of the relation
– each Ai is an attribute name in the schema of relation r
– Di is the data type of values in the domain of attribute Ai
15. Integrity Constraints In Create Table
not null
primary key (A1, . . ., An)
check (P), where P is a predicate
Example: Declare branch-name as the primary key for
branch and ensure that the values of assets are non-negative.
create table branch
(branch-name char(15) not null,
branch-city char(30),
assets integer,
primary key (branch-name),
check (assets >= 0))
primary key declaration on an attribute automatically
ensures not null in SQL-92
16. Drop and Alter Table Constructs
The drop table command deletes all information about
the dropped relation from the database.
The alter table command is used to add attributes to an
existing relation. All tuples in the relation are assigned null
as the value for the new attribute. The form of the alter
table command is
alter table r add A D
where A is the name of the attribute be added to relation r
and D is the domain of A.
The alter table command can also be used to drop
attributes of a relation
alter table r drop A
where A is the name of an attribute of relation r.