MYSQL Assignment
June 3, 2026 3 min read

Practice questions for MYSQL RDBMS

HS
HEMANT SINGH
Technical Writer & Educator

1. Create Database

  • Write a query to create a database called employee_management.
  • Create a database called university_portal.

2. Create Table

  • In the employee_management database, create a table named employees with columns: employee_id (INT), name (VARCHAR), department (VARCHAR), and salary (DECIMAL).
  • Create a table named courses in the university_portal database with columns: course_id (INT), course_name (VARCHAR), credits (INT), and instructor (VARCHAR).

3. Insert Record

  • Insert a new record into the employees table with appropriate values for employee_id, name, department, and salary.
  • Add a new record in the courses table for a course with the fields course_id, course_name, credits, and instructor.

4. Delete Record

  • Delete a record from the employees table where the employee_id is 5.
  • Remove a course from the courses table where the course_id is 101.

5. Update Record

  • Update the salary of an employee in the employees table where employee_id is 3.
  • Change the course_name of a course in the courses table where course_id is 105.

6. Add New Column

  • Add a new column email (VARCHAR) to the employees table.
  • Add a new column semester (VARCHAR) to the courses table.

7. Delete Existing Column

  • Remove the email column from the employees table.
  • Drop the semester column from the courses table.

8. Modify the Column

  • Modify the name column in the employees table to have a maximum of 150 characters.
  • Change the credits column in the courses table to DECIMAL(5,2) to store decimal values.