24 Dec Top SQL Interview Questions and Answers
The top SQL Interview Questions and Answers are given here. The level of questions is suitable for beginners as well as advanced database developers.
Let’s begin!
Ques 1. Which SQL Statement is used to create a new database?
- CREATE DB Statement
- CREATE DBS Statement
- CREATE DATABASE Statement
- ADD DBASE Statement
Ques 2. Which SQL Statement is used to create a new table?
- CREATE TABLE Statement
- CREATE TB Statement
- ADD TABLE Statement
- ADD NEW Statement
Ques 3. Which SQL Statement is used to select records?
- SELECT Statement
- SELECT RECORDS Statement
- SELECT REC Statement
- SELECT RECORD Statement
Ques 4. Which SQL Statement is used to select and return only distinct values from a table?
- SELECT VALUES Statement
- SELECT Statement
- DISTINCT Statement
- SELECT DISTINCT Statement
Ques 5. Which SQL Statement is used to insert records in a table?
- INSERT INTO Statement
- INSERT Statement
- INSERT RECORDS Statement
- INSERT VALUES Statement
Ques 6. How to fetch all records from a table “Employee”
- SELECT INTO FROM Employee
- SELECT ALL FROM Employee
- SELECT ** FROM Employee
- SELECT * FROM Employee
Ques 7. How to order a column “Salary” in Descending Order in SQL?
- order by Salary;
- order by Salary DESC;
- order Salary DESC;
- order Salary;
Ques 8. Which SQL Operator is used to display records only if both conditions are TRUE?
- OR Operator
- NOT Operator
- Like Operator
- AND Operator
Ques 9. Which SQL Operator is used to display records only if any one of the conditions is TRUE?
- Like Operator
- IN Operator
- OR Operator
- AND Operator
Ques 10. How to select all the records from a table named “Employee” where the “Salary” is not 5000?
- select * from Employee where Salary!=5000;
- select * from Employee where not Salary=5000;
- select * from Employee where Salary~=5000;
- None of the above
Ques 11. Which SQL Operator is a shorthand for multiple OR conditions?
- IN Operator
- LIKE Operator
- AND Operator
- None of the above
Ques 12. Which SQL Operator is used to find values in a range?
- RANGE Operator
- BETWEEN Operator
- RANGE_VALUES Operator
- None of the above
Ques 13. How to select all the records from a table name “Employee”, where the value of the column “EmpName” ends with “I”
- select * from Employee where EmpName LIKE ‘%i%’
- select * from Employee where EmpName LIKE ‘_i’
- select * from Employee where EmpName LIKE ‘i_’
- select * from Employee where EmpName LIKE ‘%i’
Ques 14. How to get the minimum salary from the “Salary” column in a table named “Employee”
- selectmin() from Employee
- select min(Salary) from Employee
- select minimum(Salary) from Employee
- selectminimum() from Employee
Ques 15. Which SQL function is used to count the number of rows?
- COUNT() Function
- ROWNUM() Function
- ROWNUMBER() Function
- COUNT_ROW() Function
Ques 16. Can a Primary Key Column have NULL values?
- Yes
- No
Ques 17. A child table is a table with a __________ key?
- Foreign Key
- Primary Key
Ques 18. Select the top 50% of employees from a table named “Employee” in SQL?
- select limit 50 percent * from Employee;
- select fetch first 50 percent * from Employee;
- select 50 percent * from Employee;
- select top 50 percent * from Employee;
Ques 19. Which SQL Statement is used to backup an SQL database in a local directory?
- backup DB Statement
- backup database Statement
- backup Statement
- backup DBASE Statement
Ques 20. Which statement in SQL is used to add, delete or modify columns in an existing table?
- MODIFY TABLE Statement
- ALTER TABLE Statement
- TRUNCATE TABLE Statement
- None of the Above
Ques 21. Which statement in SQL is used to create a procedure?
- CREATE PROCEDURE Statement
- CREATE PROC Statement
- CREATE FUNCTION Statement
- CREATE FUNC Statement
Ques 22. A view is a virtual table created from the actual table, displaying the current result-set?
- True
- False
If you find the SQL Interview Questions & Answers, spread the word and share the link and our website Studyopedia with others.
For Videos, Join Our YouTube Channel: Join Now
Read More:
No Comments