SQL Flashcards

1
Q

A primary key is a unique identifier for a row in a table. It is used to uniquely identify each row and ensure data integrity. A primary key can be a single column or a combination of columns, and it must have a unique value for each row in the table.

A

Primary Key

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

A foreign key is a column or a set of columns in a table that refers to the primary key of another table. It is used to establish relationships between tables in a relational database, allowing for data integrity and consistency.

A

Foreign Key

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

An index is a database object that provides a fast and efficient way to look up data in a table based on the values in one or more columns. It is used to speed up query performance by reducing the amount of data that needs to be searched.

A

Index

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

A query is a request for data from a database, usually written in SQL. It is used to retrieve, manipulate, and analyze data stored in a database. Common types of queries include SELECT (to retrieve data), INSERT ( to add new data), UPDATE (to modify existing data), and DELETE (to remove data) queries.

A

Query

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

A mechanism used in relational databases to combine data from two or more tables based on related columns.

A

SQL JOIN

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

Returns only the rows where there is a matching both tables being joined. It combines rows from two or more tables based on the specified join condition, and only the rows that satisfy the join condition are included in the result.

A

INNER JOIN

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

Used to merge rows from multiple tables or queries that have the same column structure into a single result set, without duplicates.

A

Union

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