Professional Documents
Culture Documents
CSSE-604 SOFTWARE
TESTING
Assignment #2:SQL Queries
Course Instructor: Sir Fazeel Shaikh
Group members:
Muhammad Uzair Khan
(EB19103086)
2
SQL Queries
1. Insert Into
The INSERT INTO statement is used to insert new records in a table.
3
2. SUB QUERY
A Subquery or Inner query or a Nested query is a query within another SQL query.
4
3. Select Into
The SELECT INTO statement copies data from one table into a new table.
5
5. HAVING
The HAVING clause was added to SQL because the WHERE keyword cannot be used with
aggregate functions.
6. EXISTS
The EXISTS operator is used to test for the existence of any record in a subquery.
7
7. WHERE
WHERE Clause in MySQL is a keyword used to specify the exact criteria of data or rows that
will be affected by the specified SQL statement.
8
8. SELF JOIN
A self-join is a regular join, but the table is joined with itself.
9
9. INNER JOIN:
The INNER JOIN keyword selects records that have matching values in both tables.
10
13. MIN:
The MIN() function returns the smallest value of the selected column.
13
14. MAX:
The MAX() function returns the largest value of the selected column.
15. AVG:
The AVG() function returns the average value of a numeric column.
14
16. SUM:
The SUM() function returns the total sum of a numeric column.
17. COUNT:
The COUNT() function returns the number of rows that matches a specified criterion.
15
18. AND/OR:
The AND and OR operators are used to filter records based on more than one condition:
16
20. CASE:
The CASE expression goes through conditions and returns a value when the first condition
is met (like an if-then-else statement).
17
22. INDEX:
An index is a data structure such as B-Tree that improves the speed of data retrieval on a
table at the cost of additional writes and storage to maintain it.
24. VIEW:
In SQL, a view is a virtual table based on the result-set of an SQL statement.