SQL Flash Cards

What is SQL?
Answer: SQL (Structured Query Language) is a programming language used for managing relational databases and performing operations on the data stored in them.
What is a database?
Answer: A database is an organized collection of structured data stored in a computer system.
What is a table in SQL?
Answer: A table is a collection of data organized in rows and columns.
What is a primary key in SQL?
Answer: A primary key is a unique identifier for a record in a table.
What is a foreign key in SQL?
Answer: A foreign key is a field in a table that refers to the primary key of another table.
What is the SELECT statement used for in SQL?
Answer: The SELECT statement is used to retrieve data from a database.
What is the WHERE clause used for in SQL?
Answer: The WHERE clause is used to filter data based on a specified condition.
What is the ORDER BY clause used for in SQL?
Answer: The ORDER BY clause is used to sort the data retrieved by a SELECT statement.
What is the JOIN statement used for in SQL?
Answer: The JOIN statement is used to combine data from two or more tables based on a related column.
What is the difference between a LEFT JOIN and a RIGHT JOIN in SQL?
Answer: A LEFT JOIN returns all records from the left table and the matched records from the right table, while a RIGHT JOIN returns all records from the right table and the matched records from the left table.
What is the GROUP BY clause used for in SQL?
Answer: The GROUP BY clause is used to group the result set by one or more columns.
What is the HAVING clause used for in SQL?
Answer: The HAVING clause is used to filter groups based on a specified condition
What is the MAX function used for in SQL?
Answer: The MAX function is used to return the maximum value in a specified column.
What is the MIN function used for in SQL?
Answer: The MIN function is used to return the minimum value in a specified column.
What is the AVG function used for in SQL?
Answer: The AVG function is used to return the average value of a specified column.
What is the SUM function used for in SQL?
Answer: The SUM function is used to return the sum of a specified column.
What is the INSERT statement used for in SQL?
Answer: The INSERT statement is used to insert data into a table.
What is the UPDATE statement used for in SQL?
Answer: The UPDATE statement is used to update data in a table.
What is the DELETE statement used for in SQL?
Answer: The DELETE statement is used to delete data from a table
What is CRUD
CREATE, READ, UPDATE, DELETE
What is a view in SQL?
Answer: A view is a virtual table that is based on the result set of a SELECT statement.