Tutorial -3
Date: 05/08/2025 Subject : DMS Time : 60Mins
_________________________________________________________________________________________________________
MySQL DDL and DML Queries
� MySQL DDL (Data Definition Language) Questions
1. Create a table called `employees` with the following fields:
- emp_id (INT, primary key)
- first_name (VARCHAR 50)
- last_name (VARCHAR 50)
- hire_date (DATE)
- salary (DECIMAL)
2. Modify the `employees` table to add a new column `email`
(VARCHAR 100).
3. Rename the column `salary` to `monthly_salary` in the `employees`
table.
4. Drop the `email` column from the `employees` table.
5. Delete (drop) the entire `employees` table.
6. Truncate all data in the `employees` table but keep the structure.
� MySQL DML (Data Manipulation Language) Questions
1. Insert the following employee into the `employees` table:
- ID: 1, Name: John Doe, Hire Date: 2020-01-01, Salary: 5000
2. Update the salary of employee with `emp_id` = 1 to 6000.
3. Delete the employee with `emp_id` = 1.
4. Insert multiple records into the `employees` table in one query.
5. Select all employees who were hired after 2021.
6. Find employees with salary greater than 7000.