Week 2: Advanced SQL

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

19 Terms

1
New cards

SQL Joins

This clause is used to combine records from two or more tables in a database, based on a common field between them other keywords are combined with the SELECT statement

2
New cards

INNER JOIN

Returns rows when there is at least one match in both tables.

3
New cards

OUTER JOIN

An extension of INNER JOIN. But it does not require each record in the two joined tables to have a matching record.

4
New cards

LEFT JOIN

Returns all rows from the left table, even if no matches exist in the right table.

5
New cards

RIGHT JOIN

Returns all rows from the right table, even if no matches exist in the left table.

6
New cards

FULL JOIN

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.

7
New cards

CROSS JOIN

It returns all possible combinations of rows from the two tables.

8
New cards

Subquery

A SELECT statement embedded within another SELECT statement.

9
New cards

Scalar Subquery

This subquery returns a single value.

10
New cards

Row Subquery

This subquery returns multiple columns, single row.

11
New cards

Table Subquery

This subquery returns multiple rows and columns.

12
New cards

Index

A structure used to improve search efficiency and avoid duplicate column values.

13
New cards

Creating Index Syntax

CREATE INDEX index_name ON table_name(column);

14
New cards

DROP INDEX

It is used to delete index.

15
New cards

View

A virtual table based on a SELECT query.

16
New cards

CREATE VIEW

Is a virtual table based on a SELECT query.

17
New cards

Create View Syntax

CREATE VIEW view_name AS SELECT query;

18
New cards

ALTER VIEW

It is the keyword used to modify a created view.

19
New cards

DROP VIEW

It is used to delete a view that was previously created.