Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Master SQL interviews (Top Interview questions & answers)
Rating: 4.5 out of 5(46 ratings)
559 students

Master SQL interviews (Top Interview questions & answers)

Learn Most Common SQL interview questions and answers with detailed explanations & hands on examples
Created byBiswajit Nanda
Last updated 8/2022
English

What you'll learn

  • Will be able to revise all important SQL concepts like RDBMS, Joins, Indexes, various constraints etc.
  • Will learn top SQL interview questions and their answers.
  • Will learn SQL programming questions and answers like top nth salary from table and ranks
  • Multiple approaches to tackle the same interview question

Course content

1 section86 lectures2h 13m total length
  • Question 1: What is a Database?0:10
  • Question 2: What is the difference between a database and DBMS?0:47
  • Question 3: What is the difference between DBMS and Relational DBMS?0:32
  • Question 4. What are DDL, DML and DCL statements?0:52
  • Question 5: What is SQL?0:52
  • Question 6: How do you create a table?1:43
  • Question 7: What is the difference between CHAR and VARCHAR2 datatype in sql2:21
  • Question 8: How do you create a table from another table?3:48
  • Question 9: How do you insert values into a table?3:59

    Learn how to insert values into a table using insert statements, specify column names to control order, and handle partial column lists or select-based inserts.

  • Question 10: Can you insert data into the same table by taking data from it?1:13
  • Question 11: What will happen if you insert a bigger value into a varchar column1:03
  • Question 12: How do you select data from a table?1:30
  • Question 13: How do you select data from a table using WHERE clause?2:02
  • Question 14: How do you delete all data from a table?0:41
  • Question 15: How do you delete data from a table based on a condition?1:16
  • Question 16: What is the difference between DELETE and TRUNCATE statements?1:10
  • Question 17: How do you drop a table?1:47
  • Question 18: What is the difference between Delete and Drop?1:34
  • Question 19: What are constraints and what is their importance?1:46
  • Question 20: What is a Primary Key?1:12

    Define a primary key that uniquely identifies each row, can be a single or composite key, and must contain unique values, noting there is typically only one primary key.

  • Question 21: How do you create a Primary key while creating a table?0:53
  • Question 22: How do you create a table level Primary Key?0:44
  • Question 23: How do you create a Unique Key while creating a table?1:11
  • Question 24: How do you create a table level Unique Key?1:29
  • Question 25: What is the difference between a Primary Key and Unique Key?2:30
  • Question 26: How do you create a Check constraint while creating a table?1:53

    Learn how to define a check constraint at table creation to enforce age values greater than 25, preventing invalid inserts and triggering a check constraint violation error when violated.

  • Question 27: How do you create a table level check constraint?2:49
  • Question 28: Create a check constraint to restrict values to a range1:10
  • Question 29: Create a check constraint to have name starting with A2:06
  • Question 30: How do you create a foreign key on a table?2:44
  • Question 31: How do you create a table level foreign key?1:46
  • Question 32: What is meant by a nullable column?1:00
  • Question 33: What are aggregate functions?0:25
  • Question 34: Write a SQL statement to count the total number of rows of a table0:42
  • Question 35: Write a SQL statement to count number of rows matching a condition0:57
  • Question 36: Write a SQL statement where column matches with a string value(LIKE1:29
  • Question 37: How do you calculate the average,minimum and maximum salary from em0:42
  • Question 38: How do you calculate total salary for employees grouped by employee1:18
  • Question 39: How do you select data in a table in sorted order(Asc & and desc)1:16

    Learn to select data in a table in sorted order, using ascending by default and applying descending to view results, with examples showing how to sort data.

  • Question 40: How do you specify a condition with a GROUP BY clause?2:03
  • Question 41: Can you have both HAVING and WHERE clauses together?1:06
  • Question 42: Write a query to display schema of a table1:43
  • Question 43: Alter a table to add a new column to a table0:56
  • Question 44: How do you change the data type of a column of a table1:18
  • Question 45: How do you drop a column from a table?0:54
  • Question 46: What is a Join?1:10

    Learn how joins combine two or more tables based on related data to retrieve customer and order details, including customer id, customer name, contact name, country, and order date.

  • Question 47: Explain different types of joins0:49
  • Question 48: What is the difference between an outer join and inner join?2:36
  • Question 49: What is the difference between Left Inner Join and Left Outer join?1:28
  • Question 50: What is Cross Join? Where is it useful?2:40
  • Question 51: What is Full Join?1:40
  • Question 52: What is Self Join?2:40

    Self joins show how a table is joined to itself to retrieve the manager name by matching the employee's manager id in the same data, using aliases.

  • Question 53: Write a sql statement to display current date and time0:30

    Execute a select statement to display the current date and time using a system function. See how the function returns the system date and time with example values.

  • Question 54: Write a sql statement to display the server and database name0:35
  • Question 55: Write a sql statement to display the user name0:27
  • Question 56: Write a sql statement to display the number of tables present in db1:50
  • Question 57: Write sql to display the second highest salary from employee table2:02
  • Question 58: Write a SQL query to return a substring from a string1:36
  • Question 59: Write a SQL query to return the no of characters of a given string0:41
  • Question 60: Write SQL to return the numeric position of a character in a string1:05
  • Question 61: Write a SQL statement to display distinct salaries from a table0:54
  • Question 62: How do you concatenate two strings in sql?1:08
  • Question 63: Create a empty table with the same structure as another table1:20

    Question 63 teaches how to create an empty table with the same structure as another table using select into and a false where clause.

  • Question 64: SQL to return first 3 characters(right and middle also) of a string1:37
  • Question 65: What are indexes? Why they are used?1:59
  • Question 66: What are clustered indexes?2:28

    Explain what a clustered index is, how it sorts table data in order, and how a primary key creates a clustering index. Learn to create one with the cluster keyword.

  • Question 67: What are non-clustered index?2:28

    Explore non-clustered indexes, an index structure separate from table data, including composite indexes, that boost query performance on frequently used columns, with steps to create and verify them.

  • Question 68: What is a Unique index? Write a SQL to create one2:29
  • Question 69: What is a view? Write a sql statement to create a view1:43
  • Question 70: Write a sql statement to display the number of views present1:40

    learn to write a sql statement that displays user defined views by querying information_schema.tables where table_type = 'VIEW' and excluding system schemas.

  • Question 71: What is a subquery? Why is it used?2:12
  • Question 72: Write a query to remove spaces present in a string from sides1:34

    Discover how to remove spaces from the left, right, and both sides of a string in SQL, with examples illustrating left trim, right trim, and full trim.

  • Question 73: What is the difference between Union and Union all?2:04

    Compare union and union all by showing how they combine data from two tables, with union removing duplicates and union all preserving them.

  • Question 74: What is EXCEPT or MINUS operator?1:49
  • Question 75: What is Intersect operator?0:55
  • Question 76: What are temp tables in SQL Server?1:06
  • Question 77: What are global temp tables in SQL?1:13
  • Question 78: How to get nth maximum salary from a table?3:13
  • Question 79: Nth maximum salary when there are duplicate salaries4:22
  • Question 80: What is COALESCE function in SQL?1:36
  • Question 81: What is OLTP?1:24
  • Question 82: What is the difference between OLTP and OLAP systems?1:21
  • Question 83: What are the different types of relationship existing in RDBMS?1:02
  • Question 84: How to create a temp table in SQL Server?0:41
  • Question 85: How to write a CASE statement in SQL?2:24
  • Question 86: How do we delete duplicate rows?1:52

Requirements

  • Basic SQL knowledge will be beneficial

Description

This course has been intended for programmers and testers who want to master SQL interview questions and answers.


Most of the modern applications  create data in a backend database and hence knowing SQL is an essential skill for everyone. The course covers a number of questions and answers in the following areas


1) Databases

2) Various types of Database Management system

3) Different types of SQL statements - DDL, DML and DCL statements

4) SQL introduction

5) Creating tables

6) SQL Data types

7) SELECT INTO operations

8) Conditional SELECT operations

9) DELETE ALL and Conditional DELETE operations

10) DELETE and TRUNCATE operation comparison

11) DROP table operations

12) Data Integrity and constraints

13) Column level and Table level primary Keys

14) Creating Unique keys

15) Various types of check constraints

16) Nullable columns

17) Aggregate functions

18) SQL statements to address different goals

19) Displaying schema of tables

20) What are JOINS?

21) Different types of JOINS - Inner Join, Left Outer, Right Outer and Full Outer Joins

22) What is SELF and Cross Joins?

23) Displaying System Date and time

24) Displaying server and database names

25) Various string operations - Substring, CHARINDEX, Concatenation etc

26) Creating an empty table from an existing table

27) LEFT, RIGHT operations

28) What are indexes? 

29) Describe Clustered indexes

30) Non-clustered indexes and difference from Clustered indexes

31) Describe Unique Indexes

and many more ...



Who this course is for:

  • This course has been designed for Data scientists, programmers and testers looking to master SQL interviews