Microsoft SQL Server Practice Exercises: Essential Techniques for Mastering the Framework

Here is a short practice for Microsoft SQL Server:

  1. Open SQL Server Management Studio and connect to your SQL Server instance.
  2. Create a new database called “PracticeDB”.
  3. Create a new table called “employees” with the following columns:
  • “id” (integer)
  • “first_name” (varchar(50))
  • “last_name” (varchar(50))
  • “position” (varchar(100))
  • “salary” (decimal(10,2))
  1. Insert the following data into the “employees” table:
  • (1, ‘John’, ‘Doe’, ‘Manager’, 80000)
  • (2, ‘Jane’, ‘Doe’, ‘Developer’, 75000)
  • (3, ‘Jim’, ‘Smith’, ‘Tester’, 65000)
  • (4, ‘Amy’, ‘Johnson’, ‘Designer’, 70000)
  1. Retrieve all data from the “employees” table and order the results by salary in ascending order.
  2. Update the position of employee with id 3 to ‘QA Engineer’.
  3. Delete the employee with id 4 from the “employees” table.
  4. Retrieve the first name and last name of all employees who have a salary greater than $70,000.

By following these steps, you will practice basic SQL commands such as SELECT, INSERT, UPDATE, and DELETE and gain experience with managing data in Microsoft SQL Server.

Tags: No tags

Add a Comment

Your email address will not be published. Required fields are marked *