TGTGInsighttelegram intelligenceLIVE / telegram public index
← Data Analytics
Data Analytics avatar

TGINSIGHT POST

Post #2132

@sqlspecialist

Data Analytics

Views4,960Post view count
PostedAug 808/08/2025, 09:42 AM
Post content

Post content

15 SQL interview questions for freshers 1) What is SQL and what is it used for? Answer: SQL is a language for managing and querying relational databases. It’s used to retrieve, insert, update, delete data and to manage schema and permissions. 2) What are the different types of SQL statements? Answer: DDL (Data Definition Language), DML (Data Manipulation Language), DCL (Data Control Language), and DTL (Transaction Control Language). 3) What is a primary key? Answer: A unique identifier for each row in a table; cannot be NULL. 4) What is a foreign key? Answer: A field that creates a link between two tables, enforcing referential integrity. 5) What is the difference between INNER JOIN and LEFT JOIN? Answer: INNER JOIN returns matching rows from both tables; LEFT JOIN returns all rows from the left table and matched rows from the right table (NULL if no match). 6) What is normalization? Answer: Organizing data to reduce redundancy by dividing into related tables and defining relationships. 7) What is a database index? Answer: A data structure that improves the speed of data retrieval; can be on one or more columns. 8) What is GROUP BY and HAVING? Answer: GROUP BY aggregates rows by column(s); HAVING filters groups after aggregation (unlike WHERE which filters rows before aggregation). 9) What is a subquery? Answer: A query nested inside another query, used to perform operations that depend on another query’s result. 10) What is a view? Answer: A saved query that presents data as a virtual table; does not store data itself. 11) What is transaction management? Answer: Ensuring data integrity using ACID properties; COMMIT to save, ROLLBACK to undo, and SAVEPOINT to set a point to roll back to. 12) What are SQL constraints? Answer: Rules like PRIMARY KEY, FOREIGN KEY, NOT NULL, UNIQUE, CHECK, and DEFAULT to enforce data integrity. 13) What is the difference between WHERE and HAVING? Answer: WHERE filters rows before grouping; HAVING filters groups after aggregation. 14) What is a stored procedure? Answer: A precompiled set of SQL statements stored in the database, can be executed with parameters. 15) What is the difference between UNION and UNION ALL? Answer: UNION removes duplicates between results; UNION ALL keeps all rows, including duplicates. 💬React with ❤️ for more! 😊