

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Includes inside third experiment of dbms
Typology: Exercises
1 / 3
This page cannot be seen from the preview
Don't miss anything!
SQL, Structured Query Language, is a programming language designed to manage data stored in rela�onal databases. SQL operates through simple, declara�ve statements. This keeps data accurate and secure, and it helps maintain the integrity of databases, regardless of size.
COMMANDS
ALTER TABLE lets you add columns to a table in a database.
AND is an operator that combines two condi�ons. Both condi�ons must be true for the row to be included in the result set.
AS is a keyword in SQL that allows you to rename a column or table using an alias.
AVG() is an aggregate func�on that returns the average value for a numeric column.
The BETWEEN operator is used to filter the result set within a certain range. The values can be numbers, text or dates.
CASE statements are used to create different outputs (usually in the SELECT statement). It is SQL's way of handling if-then logic.
COUNT() is a func�on that takes the name of a column as an argument and counts the number of rows where the column is not NULL.
CREATE TABLE creates a new table in the database. It allows you to specify the name of the table and the name of each column in the table.
DELETE statements are used to remove rows from a table.
GROUP BY is a clause in SQL that is only used with aggregate func�ons. It is used in collabora�on with the SELECT statement to arrange iden�cal data into groups.
HAVING was added to SQL because the WHERE keyword could not be used with aggregate func�ons.
An inner join will combine rows from different tables if the join condi�on is true.
13.INSERT
INSERT statements are used to add a new row to a table.
IS NULL and IS NOT NULL are operators used with the WHERE clause to test for empty values.
LIKE is a special operator used with the WHERE clause to search for a specific pa�ern in a column.
LIMIT is a clause that lets you specify the maximum number of rows the result set will have.
MAX() is a func�on that takes the name of a column as an argument and returns the largest value in that column.
MIN() is a func�on that takes the name of a column as an argument and returns the smallest value in that column.
OR is an operator that filters the result set to only include rows where either condi�on is true.
ORDER BY is a clause that indicates you want to sort the result set by a par�cular column either alphabe�cally or numerically.
An outer join will combine rows from different tables even if the join condi�on is not met. Every row in the le� table is returned in the result set, and if the join condi�on is not met, then NULL values are used to fill in the columns from the right table.