New Microsoft Word Document (2)
New Microsoft Word Document (2)
2. SQL Commands
SQL commands are grouped into different categories:
5. SQL Functions
• COUNT():
Returns the number of rows.
• SELECT COUNT(*) FROM students;
• AVG():
Returns the average of a column.
• SELECT AVG(age) FROM students;
• SUM():
Returns the sum of a numeric column.
• SELECT SUM(age) FROM students;
• MIN() / MAX():
Returns the minimum or maximum value of a column.
• SELECT MIN(age) FROM students;
• SELECT MAX(age) FROM students;
• CONCAT():
Combines two or more strings.
• SELECT CONCAT(first_name, ' ', last_name) AS full_name FROM students;
6. Normalization
• What is Normalization?
o The process of organizing data to reduce redundancy and dependency by dividing
large tables into smaller ones.
o Aims to ensure that the database is efficient and free of data anomalies.
Normal Forms:
This is a simplified summary of SQL. If you need more in-depth explanations or specific
examples, feel free to ask!