SQL Flashcards
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.
Primary Key
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.
Foreign Key
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.
Index
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.
Query
A mechanism used in relational databases to combine data from two or more tables based on related columns.
SQL JOIN
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.
INNER JOIN
Used to merge rows from multiple tables or queries that have the same column structure into a single result set, without duplicates.
Union