CODING ARMY ✔️
June 20, 2025 at 05:31 PM
SQL Interview Questions with Answers 1. How to change a table name in SQL? This is the command to change a table name in SQL: ALTER TABLE table_name RENAME TO new_table_name; We will start off by giving the keywords ALTER TABLE, then we will follow it up by giving the original name of the table, after that, we will give in the keywords RENAME TO and finally, we will give the new table name. 2. How to use LIKE in SQL? The LIKE operator checks if an attribute value matches a given string pattern. Here is an example of LIKE operator SELECT * FROM employees WHERE first_name like ‘Steven’; With this command, we will be able to extract all the records where the first name is like “Steven”. 3. If we drop a table, does it also drop related objects like constraints, indexes, columns, default, views and sorted procedures? Yes, SQL server drops all related objects, which exists inside a table like constraints, indexes, columns, defaults etc. But dropping a table will not drop views and sorted procedures as they exist outside the table. 4. Explain SQL Constraints. SQL Constraints are used to specify the rules of data type in a table. They can be specified while creating and altering the table. The following are the constraints in SQL: NOT NULL CHECK DEFAULT UNIQUE PRIMARY KEY FOREIGN KEY React ❤️ for more
Image from CODING ARMY ✔️: SQL Interview Questions with Answers  1. How to change a table name in...
❤️ 👍 😂 10

Comments