This repository contains a collection of SQL practice exercises focused on various aspects of database management. These exercises cover a wide range of SQL commands, including queries, updates, insertions, and deletions. The exercises are designed to improve SQL skills and provide practical examples of common database operations.
- sql_practices.sql: This file contains all the SQL commands used during the practice sessions, including exercises on querying data, filtering results, updating records, and more.
- Retrieve all records: Selecting all records from the
kitaplar
table. - Select specific columns: Selecting specific columns from the
yazarlar
table.
- Filter by specific values: Using
WHERE
to filter records based on specific criteria (e.g., finding authors named "Orhan"). - Using
DISTINCT
: Listing unique author names. - Pattern matching with
LIKE
: Finding authors whose names start with certain letters.
- Using
AND
,OR
: Combining multiple conditions to filter data, such as finding books published in a specific year and priced at a certain amount.
- Order by specific columns: Sorting results based on price, page count, or author names.
- Limit results: Retrieving the top N records from the table.
- Find the youngest/oldest author: Using
MIN
andMAX
to find extreme values. - Calculate totals: Using functions like
SUM
,AVG
for aggregation.
- Insert new records: Adding new authors to the
yazarlar
table. - Bulk insertions: Inserting multiple records in a single query.
- Update specific fields: Updating hints in the
demo
table based on certain conditions.
- Delete specific records: Removing records based on their ID or other criteria.
To run the SQL scripts in this repository, you will need:
- SQLite: Download and install SQLite from here.
- Alternatively, you can use SQLite Online to run the scripts directly in your browser.
These exercises are intended for educational purposes and to enhance your SQL skills. The SQL commands are written in a way that they can be run in sequence without conflicts, making them ideal for step-by-step practice.
This project is open-source and available under the MIT License.
If you have any questions or feedback, please feel free to contact me at mervekartal07@gmail.com.