Database Terminology
Essential SQL Concepts for Beginners
Understanding key database terminology is critical for anyone learning SQL or managing relational databases. This guide covers all the foundational terms and concepts used in SQL—from database design to everyday operations.
What is a Database?
A database is an organized collection of structured data stored electronically. In SQL, data is arranged into tables that allow efficient retrieval, manipulation, and updating.
Key Database Terms
1. Table
The basic unit for storing data; a table organizes data into rows and columns.
Example: A “Customers” table contains columns like Name, Email, Phone.
2. Row and Column
Row: A single record in a table (also called a tuple).
Column: Defines a field or attribute of each record (e.g., “Email”).
3. Primary Key
A column (or set of columns) that uniquely identifies each row in a table.
4. Foreign Key
A column that creates a link between two tables—referencing the primary key of another table.
Example: OrderID in the Orders table refers to CustomerID in Customers.
5. Schema
The structure defining tables, relationships, and rules in the database.
6. Query
An SQL command used to retrieve or manipulate database data.
Example:
SELECT * FROM Customers;retrieves all data from the Customers table.
7. SQL (Structured Query Language)
The programming language for managing relational databases.
Handles operations like creating tables, inserting, updating, and deleting data.
8. Data Types
Define the type of data allowed in each column, such as
VARCHAR(string),INT(integer),DATE,BLOB(binary large object).
9. Index
10. Constraints
Rules applied to table columns for data validity (e.g., NOT NULL, UNIQUE, CHECK).
11. CRUD
Stands for Create, Read, Update, Delete—the four basic operations you can perform on database data.
Common SQL Commands
| Command | Description | Example (SQL) |
|---|---|---|
| SELECT | Retrieves data from a table | SELECT * FROM Customers; |
| INSERT | Adds new rows to a table | INSERT INTO Customers (Name) VALUES ('Raj'); |
| UPDATE | Modifies existing data | UPDATE Customers SET Name='Ravi' WHERE ID=3; |
| DELETE | Removes rows from a table | DELETE FROM Customers WHERE ID=3; |
| CREATE | Builds a new database or table | CREATE TABLE Orders (OrderID INT); |
| DROP | Deletes a table, database, or column | DROP TABLE Orders; |
| ALTER | Changes table structure (add column, etc.) | ALTER TABLE Customers ADD Age INT; |
Advanced Terms
ACID: Atomicity, Consistency, Isolation, Durability—properties that ensure reliable transaction processing.
Backup: Creating copies of your database to prevent data loss.
Trigger: Automatically executes code in response to table events (e.g., before insert).
DDL/DML/DCL: SQL sub-languages:
DDL (Data Definition Language): Create, Alter, Drop.
DML (Data Manipulation Language): Select, Insert, Update, Delete.
DCL (Data Control Language): Grant, Revoke access.
In Summary
Knowing these key database terms and SQL concepts is the first step toward becoming proficient in data organization and management. Master these basics to lay a solid foundation for deeper learning and more advanced database operations.
Comments
Post a Comment