Get Membership To Play All Videos In This Website.
Sign-in
Sign-up
Regular
Python
Membership
DataEngineering
Basics
Video Courses
Telugu Language
English Language
Online Tests
Online Test
Interview Questions
Online Store
Python Blog
Online Test
1). What is the default isolation level in SQL Server??
A) READ UNCOMMITTED
B) READ COMMITTED
C) REPEATABLE READ
D) SERIALIZABLE
2). Which SQL statement is used to prevent SQL injection attacks??
A) Dynamic SQL
B) Escaping user input
C) Sanitizing input
D) Parameterized queries
3). What type of join returns only rows where there is a match in both tables??
A) LEFT JOIN
B) INNER JOIN
C) RIGHT JOIN
D) FULL JOIN
4). Which SQL function is used to get the current date and time in PostgreSQL??
A) CURRENT_TIMESTAMP
B) GETDATE()
C) NOW()
D) SYSDATE
5). How can you improve the performance of a query in SQL Server??
A) Using query hints
B) Increasing memory
C) Partitioning tables
D) Using indexes
6). What does the SQL keyword 'EXISTS' do??
A) Tests for the existence of any record in a subquery
B) Determines if a value is null
C) Checks if a column exists
D) Verifies if a table is present
7). Which clause is used to ensure that a column value is unique across all rows in a table??
A) PRIMARY KEY
B) UNIQUE
C) DISTINCT
D) FOREIGN KEY
8). What is the purpose of a 'VIEW' in SQL??
A) To create a virtual table based on a query
B) To store physical data
C) To delete a table
D) To create a new table
9). How can you retrieve all columns from a table in SQL??
A) SELECT * FROM table_name
B) SELECT ALL FROM table_name
C) SELECT table_name
D) SELECT COLUMNS FROM table_name
10). What is the purpose of the 'HAVING' clause in SQL??
A) To filter records after GROUP BY
B) To sort records after GROUP BY
C) To filter records in the WHERE clause
D) To filter records before GROUP BY
11). Which SQL statement is used to update existing records in a table??
A) UPDATE
B) ALTER
C) MODIFY
D) CHANGE
12). What does the SQL function 'ROW_NUMBER()' do??
A) Assigns a unique number to each row within the partition of a result set
B) Generates a random row number
C) Counts the number of rows in a table
D) Sorts rows by number
13). Which SQL clause is used to retrieve only distinct values from a column??
A) DISTINCT
B) UNIQUE
C) SEPARATE
D) DIFFERENT
14). How do you handle transactions in SQL to ensure data integrity??
A) Using COMMIT and ROLLBACK
B) Using LOCK TABLE
C) Using SAVEPOINT
D) Using SET TRANSACTION
15). What is a 'CTE' in SQL and how is it used??
A) Common Table Expression; used to create temporary result sets
B) Common Temporary Entity; used for temporary data storage
C) Column Table Expression; used for column operations
D) Create Temporary Entity; used to create temporary tables
16). Which function in SQL can be used to concatenate strings??
A) CONCAT()
B) JOIN()
C) MERGE()
D) COMBINE()
17). What is a 'Stored Procedure' in SQL??
A) A precompiled collection of SQL statements and optional control-of-flow statements
B) A method to access data in real-time
C) An ad-hoc query for quick data retrieval
D) A temporary table for storing data
18). How can you find duplicate records in a table??
A) SELECT column_name FROM table_name GROUP BY column_name HAVING COUNT(*) > 1
B) SELECT column_name, COUNT(*) FROM table_name GROUP BY column_name HAVING COUNT(*) > 1
C) SELECT DISTINCT column_name FROM table_name
D) SELECT column_name FROM table_name WHERE COUNT(*) > 1
19). What does the SQL function 'TRUNCATE' do??
A) Removes all rows from a table without logging individual row deletions
B) Clears data from a table but keeps the table structure
C) Deletes a table structure
D) Resets a table to its initial state
20). How can you implement a many-to-many relationship in SQL??
A) By creating a junction table with foreign keys referencing the primary tables
B) By using a self-join on one table
C) By creating a foreign key in one of the primary tables
D) By using multiple primary keys
21). What does the 'ROLLBACK' command do in SQL??
A) Undoes transactions that have not yet been committed
B) Commits all changes made during a transaction
C) Sets a savepoint in a transaction
D) Redoes transactions that were undone
22). Which clause is used to filter rows based on aggregate functions??
A) HAVING
B) WHERE
C) FILTER
D) GROUP BY
23). What type of join returns all rows from the left table and matched rows from the right table??
A) LEFT JOIN
B) INNER JOIN
C) RIGHT JOIN
D) FULL JOIN
24). Which SQL keyword is used to create a new table??
A) CREATE TABLE
B) NEW TABLE
C) ADD TABLE
D) MAKE TABLE
25). How can you get the number of rows in a table??
A) SELECT COUNT(*) FROM table_name
B) SELECT ROW_COUNT FROM table_name
C) SELECT TOTAL_ROWS FROM table_name
D) SELECT NUM_ROWS FROM table_name
Submit
Test Results