# Tutor profile: Stephanie N.

## Questions

### Subject: SQL Programming

What is the difference between DELETE and TRUNCATE in SQL Server?

- DELETE keeps the table's auto-increment value while TRUNCATE does not. For example, if the last row in a table has ID 20 and we delete that row, then the next inserted item will have an ID of 21. However, if we truncate the table, then the IDs start over at 1. - You can delete specific rows but truncate removes all of the rows in the table. - TRUNCATE is faster than DELETE

### Subject: Java Programming

How do we recursively find the factorial of an integer? Write a Java function to do this.

Below is a recursive Java function to find the factorial of a number: public static int factorial(int n) { if (n == 0) { return 1; // base case } return n * factorial(n-1); // recursive case }

### Subject: Algebra

If the first number in an arithmetic sequence is 1 and the fifth number in the sequence is 21, what is the tenth number in the sequence?

The formula to find the nth number in an arithmetic sequence is: an = a1 + d(n-1) If a1 = 1 and a5 = 21, we can solve for d: 21 = 1 + d(5-1) 21 = 1 + 5d - d 21 = 1 + 4d 20 = 4d d = 5 So the common difference equals 5. We can use a1 = 1 and d = 5 to solve for a10: a10 = 1 + 5(10-1) a10 = 1 + 50 - 5 a10 = 46 Therefore, the answer is 46.

## Contact tutor

needs and Stephanie will reply soon.