Joining Statement Flashcards

1
Q

PURPOSE & FUNCTIONS OF JOIN
OPERATIONS(7)

A
  1. Combine Data from Multiple Tables
  2. Establish Relationships Between Tables
  3. Optimize Query Efficiency
  4. Support Advanced Data Analysis
  5. Allow Versatile Data Retrieval
  6. Enhance Data
    Integrity
  7. Facilitate Real-World
    Scenarios
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Joins allow the
retrieval of related
data spread across
multiple tables in a
relational database.

A

Combine Data
from Multiple
Tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Joins leverage primary
and foreign key
relationships to link
rows in one table to
corresponding rows in
another.

A

Establish
Relationships Between
Tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

By retrieving only the
required data from
multiple tables, JOIN
operations reduce
redundancy and improve
query performance.

A

Optimize Query
Efficiency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Joins enable complex
queries that
consolidate
information for
reporting and analytics

A

Support Advanced
Data Analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Different types of JOINs
(INNER, LEFT, RIGHT,
FULL OUTER, CROSS)
provide flexibility in
fetching data depending
on the analysis needs.

A

Allow Versatile Data
Retrieval

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

By linking related
tables, JOINs help
maintain normalized
database structures
without duplicating
data.By linking related
tables, JOINs help
maintain normalized
database structures
without duplicating
data.

A

Enhance Data
Integrity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

JOINs mimic real-world
connections between
entities, making it
easier to model and
query practical
relationships.

A

Facilitate Real-World
Scenarios

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A _____clause is used to
combine rows from two or
more tables, based on a
related column between
them.

A

JOIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Syntax of JOIN

A

SELECT Orders.OrderID,
Customers.CustomerName, Orders.OrderDate
FROM Orders
INNER JOIN Customers ON Orders.CustomerID=Cus
tomers.CustomerID;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

SUPPORTED
TYPES OF
JOINS IN
MYSQL(4)

A

Inner Join
Left Join
Right Join
Cross Join

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Returns records that
have matching values in both tables

A

Inner Join

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Returns all records from
the left table, and the matched
records from the right table

A

Left Join

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Returns all records from
the right table, and the matched
records from the left table

A

Right Join

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Returns all records
from both tables

A

Cross Join

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

return rows when there is at least one match in both tables

A

Inner Join

17
Q

Inner Join Syntax

A

SELECT * FROM table1
INNER JOIN table2
ON table1.Pkey = table 2.Fkey

18
Q

does not require each record in the two joined tables to have a
matching record

A

Outer Join

19
Q

Outer Join is subdivided into 3, namely:(?)

A

Left Join
Right Join
Full Join

20
Q

returns all rows from the left table (or the first table), even if there are no
matches in the right table

A

Left Join

21
Q

returns all the rows from the right table (or the second table), even if there are
no matches in the left table

A

Right Join

22
Q

both tables are secondary (or optional), such that if rows are being matched in
table A and table B, then all rows from table A are displayed even if there is no matching
row in table B, and vice versa

A

Full Join

23
Q

are SELECT statements that
have been saved in the
database

A

VIEWS

24
Q

Some Keywords Related to VIEWS

A

CREATE VIEW
ALTER VIEW
DROP VIEW

25
Q

is a keyword that enables users to create new views

A

CREATE VIEW

26
Q

SYNTAX for CREATE VIEW

A

CREATE VIEW ViewName AS SELECT statement

27
Q

is the keyword used to
modify a created view

A

ALTER VIEW

28
Q

SYNTAX for ALTER VIEW

A

ALTER VIEW ViewName AS
SELECT statement

29
Q

is used to delete a view that was previously created

A

DROP VIEW

30
Q

SYNTAX of DROP VIEW

A

DROP VIEW ViewName