
SQL Basics
SELECT, WHERE, ORDER BY, GROUP BY, HAVING, aggregations, aliases, simple subqueries
1Which SQL statement is used to retrieve data from a table?
Which SQL statement is used to retrieve data from a table?
Answer
The SELECT statement is the fundamental command for reading data from a relational database. It allows specifying which columns to retrieve and from which table. It is the first statement every developer learns in SQL as it forms the basis of all read queries.
2How to select all columns from a table named 'users'?
How to select all columns from a table named 'users'?
Answer
The asterisk character (*) is a shortcut meaning all columns. The syntax SELECT * FROM users returns every column from the table. While convenient for exploration, explicitly naming columns is recommended in production for performance and clarity reasons.
3Which clause is used to filter rows returned by a SELECT query?
Which clause is used to filter rows returned by a SELECT query?
Answer
The WHERE clause allows specifying conditions that rows must satisfy to be included in the result. It applies before any aggregation and accepts comparison operators (=, <, >, !=), logical operators (AND, OR, NOT), and special predicates (LIKE, IN, BETWEEN).
Which operator is used to search for a pattern in a text column?
How to sort query results in ascending order on a column?
+17 interview questions
Other Data Science & ML interview topics
Python Basics
Python Object-Oriented Programming
Python Data Structures
Git Fundamentals
NumPy Fundamentals
Pandas Basics
Jupyter & Google Colab
SQL Joins & Advanced Queries
Advanced Pandas
Visualization with Matplotlib & Seaborn
Interactive Visualizations with Plotly
Descriptive Statistics
Inferential Statistics
Web Scraping
BigQuery & Cloud Data
Feature Engineering
Supervised ML: Regression
Supervised ML: Classification
Decision Trees & Ensembles
Unsupervised ML
ML Pipelines & Validation
Time Series & Forecasting
Deep Learning Fundamentals
TensorFlow & Keras
CNN & Image Classification
RNN & Sequences
Transformers & Attention
NLP & Hugging Face
GenAI & LangChain
MLOps & Deployment
Master Data Science & ML for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free