MAEDOT ASRAT ritw/0884/16
5/29/25
aDVANCE sql
Briefly define the following questions (5Pt each)
1. What is the purpose of the SELECT statement in SQL?
The SELECT statement is used to retrieve data from one or more tables in a database.
2. How do you filter records in SQL?
We can filter records using the WHERE clause, which specifies conditions that the returned
data must meet.
3. Explain the difference between INNER JOIN and LEFT JOIN.
INNER JOIN returns only the rows with matching values in both tables
LEFT JOIN returns all rows from the left table and matching rows from the right table;
unmatched rows from the right table return as NULL.
4. What is the use of the GROUP BY clause in SQL?
The GROUP BY clause groups rows with the same values in specified columns, often
used with aggregate functions like COUNT(), SUM(), etc
5. What is a Primary Key, and why is it important in SQL?
A Primary Key is a column (or combination of columns) that uniquely identifies
each row in a table. It ensures data integrity by preventing duplicate and NULL
values.
6. How do you insert a new record into a table in SQL?
You use the INSERT INTO statement,
EXAMPLE : INSERT INTO table_name (column1, column2) VALUES
(value1, value2);