Practice SQL Questions and Answers
- What is the output of this SQL snippet if the price column contains NULL values? SELECT SUM(price) FROM products;
- Which SQL command is used to remove a table completely?
- Which SQL clause is used for filtering rows?
- Which SQL function returns the number of rows in a table?
- Which SQL clause is used to group rows?
- Which command removes all rows but keeps table structure?
- Which SQL keyword prevents duplicate rows in result?
- Which SQL feature allows hierarchical queries (e.g., org chart traversal)?
- In SQL, the ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW clause applies to:
- A materialized view differs from a normal view because it:
- Recursive CTEs are mainly used for:
- ROW_NUMBER() OVER (PARTITION BY dept ORDER BY salary DESC) assigns:
- Materialized views differ from normal views because:
- Which SQL keyword removes duplicate rows automatically from results?
- Which operator is used for pattern matching in SQL?
- What is the result of SELECT COUNT(NULL) on any table?
- To rename a column in a SELECT query result, you use:
- Which SQL constraint ensures a column cannot have NULL values?
- Which SQL constraint ensures that a column’s values are unique across the table?
- A transaction in DBMS is said to be atomic if:
- Which of the following is true about a foreign key?
- In normalization, which normal form removes transitive dependencies?
- Deadlock in DBMS can be prevented using:
- Which SQL keyword is used to eliminate duplicate rows in a query result?
- Which SQL function is used to calculate the average of a numeric column?
- Which SQL clause is used to filter results after a GROUP BY operation?
- Which SQL statement combines the results of two queries and removes duplicates?
- Which SQL function returns the largest value in a column?
- Which SQL command is used to modify existing records in a table?
- Which clause is used to sort query results in SQL?
- Which SQL operator is used to search for a pattern in a column?
- Which SQL keyword is used to remove duplicate records from a query result?
- Which SQL clause is used to filter records based on aggregate functions?
- Which operator is used to combine results of two SELECT queries and remove duplicates?
- SQL Injection can be prevented by all EXCEPT:
- Which SQL clause is used to filter groups after aggregation (i.e., having aggregated value conditions)?
- Given a table employees(id, dept_id, salary), which query returns departments with average salary greater than overall average across the company?
- Which of the following SQL constructs avoids returning duplicate rows?
- Which join returns rows from the left table even when there is no matching row in the right table, filling with NULLs for the right side?
- Which index type is most beneficial for queries that use range predicates (e.g., WHERE age BETWEEN 20 AND 30)?
More Topics
- Algorithms Questions
- Analog and Digital Communication Questions
- Artificial Intelligence & Machine Language Questions
- Basics of Computers Questions
- Big Data Analytics Questions
- C Programming Questions
- C++ Questions
- Compiler Design Questions
- Computer Architecture and Design Questions
- Cyber Security Questions
- Data Analytics Languages Questions
- Data Structure Questions
- Data Warehousing Questions
- Digital Logic Questions
- IOT and mobile Computing Questions
- IT DBMS Questions
- IT Networking Questions
- IT Operating System Questions
- Machine Learning Questions
- Memory Management Questions
- Microsoft Office Questions
- Network Layer and IP Protocol Questions
- Numerical and Statistical Computing Questions
- Object Oriented Programming Questions
- OOPS Concepts Questions
- Previous Year Questions Questions
- Python Questions
- Shell Scripting Questions
- Software Engineering and Web Technology Questions