Skip to main content

10 SQL Multiple Choice Questions (MCQs)

10 SQL Multiple Choice Questions (MCQs) 





1. Which SQL statement is used to retrieve data from a database?


A. GET
B. SELECT
C. FETCH
D. READ


Answer: B. SELECT



2. What does the WHERE clause do in SQL?


A. Groups records
B. Filters records
C. Sorts records
D. Deletes records


Answer: B. Filters records



3. Which SQL function is used to count the number of rows?


A. COUNT()
B. SUM()
C. TOTAL()
D. LENGTH()


Answer: A. COUNT()



4. Which keyword is used to sort the result-set in SQL?


A. ORDER
B. GROUP
C. SORT
D. ORDER BY


Answer: D. ORDER BY



5. What is the default sorting order of ORDER BY clause?


A. Random
B. Descending
C. Ascending
D. Alphabetical


Answer: C. Ascending



6. What does the SQL JOIN clause do?


A. Combines rows from multiple tables
B. Deletes rows from a table
C. Finds duplicates
D. Creates new tables


Answer: A. Combines rows from multiple tables



7. Which JOIN returns only the matching rows from both tables?


A. LEFT JOIN
B. RIGHT JOIN
C. INNER JOIN
D. FULL OUTER JOIN


Answer: C. INNER JOIN



8. Which SQL keyword is used to remove duplicates from a result set?


A. NO DUPLICATES
B. REMOVE
C. DISTINCT
D. UNIQUE


Answer: C. DISTINCT



9. What is the purpose of the GROUP BY clause?


A. Sort data by groups
B. Summarize data into groups
C. Filter grouped data
D. Rearrange column order


Answer: B. Summarize data into groups



10. What does the LIKE operator do in SQL?


A. Joins tables
B. Deletes records
C. Filters with pattern matching
D. Adds new columns


Answer: C. Filters with pattern matching

Comments

Popular posts from this blog

Connecting Power BI to Azure Data Lake: Streamlining Big Data Analytics

Connecting Power BI to Azure Data Lake: Streamlining Big Data Analytics Azure Data Lake and Power BI provide a powerful combination for businesses to handle and analyze large datasets efficiently. Here’s a step-by-step breakdown of how connecting Power BI to Azure Data Lake helps streamline big data analytics. 1. What is Azure Data Lake? Azure Data Lake is a cloud-based storage solution designed to handle large volumes of structured and unstructured data. It provides highly scalable and cost-effective storage, making it an ideal choice for big data projects, data lakes, and large-scale analytics. 2. Benefits of Connecting Power BI to Azure Data Lake Handling Large Datasets : Power BI’s integration with Azure Data Lake allows users to work with large datasets without needing to import all the data into Power BI. Instead, users can connect and query data directly. Scalable Analytics : Azure Data Lake’s ability to scale horizontally ensures that it can handle growing volumes of data se...

Why Do People Dislike DAX and Data Modeling in Power BI?

Why Do People Dislike DAX and Data Modeling in Power BI? Many Power BI users express frustration with DAX (Data Analysis Expressions) and data modeling , primarily due to their complexity and steep learning curves.  Reasons Why People Dislike DAX Steep Learning Curve : DAX has a syntax that can feel unintuitive for newcomers, especially for those without prior experience in Excel's Power Pivot or similar analytical languages. The concept of row context vs. filter context is often confusing and requires significant effort to master. Complexity of Advanced Calculations : Basic measures like sums and averages are straightforward, but creating advanced measures (e.g., time intelligence, ranking, or cumulative totals) can quickly become overwhelming. Many users struggle with understanding functions like CALCULATE , FILTER , and ALL , which are essential for advanced analytics. Error Handling : DAX error messages are not always clear or descriptive, making it difficult to debug issues ...

Leveraging Power BI's Bookmarks and Selections for Interactive Dashboards

Leveraging Power BI's Bookmarks and Selections for Interactive Dashboards Bookmarks and Selections in Power BI are powerful features that can significantly enhance the interactivity and user experience of dashboards. Here's how you can use them effectively: 1. What are Bookmarks in Power BI? Bookmarks capture the current state of a report page, including: Visible or hidden visuals Filter states Slicer selections Sort order, drill state, and focus mode By saving different views of your report with bookmarks, you can create interactive storytelling, custom navigation, and dynamic reports. 2. What is the Selection Pane? The Selection Pane lets you control the visibility of report visuals. Using the pane, you can: Show or hide visuals based on user actions Layer visuals in an orderly manner to control how users interact with them Combine with bookmarks to toggle the visibility of different report components 3. Use Cases for Bookmarks and Selections Here are some common scenarios ...