BENGALURU · FULLTIME
SQL Interview Preparation Q&A | Part -1
ST
studyecart technologies pvt ltd
Bengaluru · onsite · Posted 46d ago
Sourced from
Not disclosedFresherfulltimeBengaluru
About a minute. You'll make an account on the way through.
agent · working
- Read this posting0.7s
- Found the form on Foundit · 5 questions to answer1.1s
- Decided the answers for all of them3.2s
- Tailor your résumé to this role
- Waiting for you
Section · 01
About this role
- What is SQL, and why is it used
SELECT * FROM Customers WHERE Country = India; (code-box)
- What are the different types of SQL statements
- DDL (Data Definition Language)
- DML (Data Manipulation Language)
- DQL (Data Query Language)
- TCL (Transaction Control Language)
- DCL (Data Control Language)
- What is the difference between DELETE and TRUNCATE
TRUNCATE: Removes all rows from a table. It is faster but cannot be rolled back.
DELETE FROM Employees WHERE ID = 1; TRUNCATE TABLE Employees;(code-box)
- What is a JOIN in SQL
SELECT Orders.OrderID, Customers.CustomerName FROM Orders INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID;(code-box)
- What are indexes in SQL
CREATE INDEX idx_customer_name ON Customers (CustomerName);(code-box)
- What is normalization in SQL
- What is a primary key
CREATE TABLE Students ( StudentID INT PRIMARY KEY, Name VARCHAR(50) );(code-box)
- What is a foreign key
CREATE TABLE Orders ( OrderID INT PRIMARY KEY, CustomerID INT, FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID) );(code-box)
- What is a stored procedure
CREATE PROCEDURE GetCustomerOrders AS SELECT * FROM Orders WHERE CustomerID = 1;(code-box)
- What is a transaction in SQL
BEGIN TRANSACTION; UPDATE Accounts SET Balance = Balance - 500 WHERE AccountID = 1; UPDATE Accounts SET Balance = Balance + 500 WHERE AccountID = 2; COMMIT;(code-box)
Sourced from foundit
Section · 02
Skills
Foreign keyPrimary keyDmlDCLDDLDQLtcltransactionsJoinIndexesNormalizationSQL