This repository contains SQL scripts for managing and querying a database. The database includes two main tables: departments and employees, and several SQL exercises to perform various operations on these tables. This project is designed for educational purposes to demonstrate basic SQL operations, including table creation, data insertion, querying, and creating stored procedures.
- Create a Database
- Use Database
- Create a Table with name departments Department_id (pk) Department_name Location_id
- Create a Table with name employees Employee_id (pk), first_name, last_name, email, phone_number, hire_date, job_id, salary, commission_pct, manager_id, department_id (fk reference)
1. Select employees first name, last name, job_id and salary whose first name starts with alphabet S
5. Write a query to select employees and their corresponding managers and their salaries (SELF Join)
10. Create a stored procedure to get the count of employees hired in the input year (IN year, OUT count)
12. Select employee first name and the corresponding phone number in the format (_ _ )-( _ )-( _ _ _)
- Mysql Task Sakila setup.pdf
This document contains the instructions and TASK2 exercises. - TASK2_Mysql_Sakila_QNA.pdf
This file includes the TASK 2 questions along with the corresponding SQL query answers. - TASK2_Mysql_Sakila.sql
This SQL file contains the SQL queries used to answer the TASK2 questions. - sakila-schema.sql
This script contains the SQL commands to create the structure of the Sakila Database. - sakila-data.sql
This script is used to insert data into the Sakila Database after the structure has been created. - sakila.mwb
This is a MySQL Workbench data model file. You can open it in MySQL Workbench to explore and examine the database structure visually.