Skip to main content

Data Analyst SQL Interview Questions

Review this list of 26 SQL Data Analyst interview questions and answers verified by hiring managers and candidates.
  • Deloitte logoAsked at Deloitte 
    3 answers

    "BETWEEN and HAVING clauses in SQL serve different purposes: 1. BETWEEN Clause Used to filter rows based on a range of values. Works with numeric, date, or text values. Can be used with WHERE or HAVING clauses. The range includes both lower and upper bounds. Example: Filtering employees with salaries between 30,000 and 50,000 `SELECT * FROM Employees WHERE salary BETWEEN 30000 AND 50000;` 2. HAVING Clause Used to filter **groups"

    Meenakshi D. - "BETWEEN and HAVING clauses in SQL serve different purposes: 1. BETWEEN Clause Used to filter rows based on a range of values. Works with numeric, date, or text values. Can be used with WHERE or HAVING clauses. The range includes both lower and upper bounds. Example: Filtering employees with salaries between 30,000 and 50,000 `SELECT * FROM Employees WHERE salary BETWEEN 30000 AND 50000;` 2. HAVING Clause Used to filter **groups"See full answer

    Data Analyst
    SQL
    +4 more
  • 7 answers
    +4

    "-- LTV = Sum of all purchases made by that user -- order the results by desc on LTV select u.user_id, sum(a.purchase_value) as LTV from user_sessions u join attribution a on u.sessionid = a.sessionid group by u.user_id order by sum(a.purchase_value) desc"

    Mohit C. - "-- LTV = Sum of all purchases made by that user -- order the results by desc on LTV select u.user_id, sum(a.purchase_value) as LTV from user_sessions u join attribution a on u.sessionid = a.sessionid group by u.user_id order by sum(a.purchase_value) desc"See full answer

    Data Analyst
    SQL
    +3 more
  • Airbnb logoAsked at Airbnb 
    2 answers

    "Clarification questions What is the purpose of connecting the DB? Do we expect high-volumes of traffic to hit the DB Do we have scalability or reliability concerns? Format Code -> DB Code -> Cache -> DB API -> Cache -> DB - APIs are built for a purpose and have a specified protocol (GET, POST, DELETE) to speak to the DB. APIs can also use a contract to retrieve information from a DB much faster than code. Load balanced APIs -> Cache -> DB **Aut"

    Aaron W. - "Clarification questions What is the purpose of connecting the DB? Do we expect high-volumes of traffic to hit the DB Do we have scalability or reliability concerns? Format Code -> DB Code -> Cache -> DB API -> Cache -> DB - APIs are built for a purpose and have a specified protocol (GET, POST, DELETE) to speak to the DB. APIs can also use a contract to retrieve information from a DB much faster than code. Load balanced APIs -> Cache -> DB **Aut"See full answer

    Data Analyst
    SQL
    +6 more
  • 6 answers
    +3

    " SELECT * FROM( SELECT c.first_name, c.last_name, t.receipt_number, COUNT(*) OVER (PARTITION BY c.customerid) AS noof_offences FROM customers c JOIN transactions t ON c.customerid = t.customerid WHERE t.receipt_number LIKE '%999%' OR t.receipt_number LIKE '%1234%' OR t.receipt_number LIKE '%XYZ%' ) sub WHERE noofoffences > 1 ; `"

    Harshitha B. - " SELECT * FROM( SELECT c.first_name, c.last_name, t.receipt_number, COUNT(*) OVER (PARTITION BY c.customerid) AS noof_offences FROM customers c JOIN transactions t ON c.customerid = t.customerid WHERE t.receipt_number LIKE '%999%' OR t.receipt_number LIKE '%1234%' OR t.receipt_number LIKE '%XYZ%' ) sub WHERE noofoffences > 1 ; `"See full answer

    Data Analyst
    SQL
    +3 more
  • Microsoft logoAsked at Microsoft 
    2 answers

    "SQL is structured query language."

    Rafia M. - "SQL is structured query language."See full answer

    Data Analyst
    SQL
    +2 more
  • 🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.

Showing 21-26 of 26