SQL Terminology Flashcards
(39 cards)
What is a Database?
A structured set of data held in a computer.
Example: A company’s HR system uses a database to store employee data.
What is a Table in SQL?
A collection of related data entries, organized in rows and columns.
Example: ‘Employees’ table with columns like id, name, department.
What is a Row (Record)?
A single data item in a table.
Example: One employee’s data in the Employees table.
What is a Column (Field)?
A single data attribute within a table.
Example: The ‘salary’ column in the Employees table.
What is a Primary Key?
A column (or set of columns) that uniquely identifies each row in a table.
Example: ‘id’ column in Employees is a primary key.
What is a Foreign Key?
A column that creates a relationship between two tables.
Example: ‘dept_id’ in Employees referencing ‘id’ in Departments.
What is a Query?
A request for data or information from a database.
Example: SELECT * FROM Employees;
What does SQL stand for?
Structured Query Language.
What does CRUD stand for?
Create, Read, Update, Delete.
What is a JOIN used for?
To combine rows from two or more tables based on a related column.
What is an Index?
A performance optimization feature that speeds up retrieval operations.
Example: CREATE INDEX idx_name ON Employees(name);
What is a NULL value?
A special marker indicating that a data value does not exist.
Example: A missing phone number in a contact table.
What is a Constraint?
A rule enforced on data columns (e.g., NOT NULL, UNIQUE).
Example: NOT NULL on ‘name’ column to prevent empty names.
What is a Schema?
The structure that defines the organization of data (tables, columns, types, etc.).
What is a View in SQL?
A virtual table based on the result-set of an SQL query.
Example: A view showing only active employees.
What is a Subquery?
A query nested inside another query.
What are Aggregate Functions?
Functions that perform calculations on multiple rows (e.g., COUNT, SUM).
What is Normalization?
The process of organizing data to reduce redundancy.
What is a Transaction?
A sequence of operations performed as a single logical unit of work.
What are the ACID properties?
Atomicity, Consistency, Isolation, Durability – guarantees for database transactions.
What is the purpose of the SELECT statement?
Retrieves data from a database.
Fill in the blank: The SQL command to select all columns from a table is ______.
SELECT * FROM table_name
What does the WHERE clause do in a SQL query?
Filters records based on specified conditions.
What is the result of using ORDER BY in a SQL query?
Sorts the result set based on specified columns.