
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.
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.
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.
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.
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.
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.
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 63 teaches how to create an empty table with the same structure as another table using select into and a false where clause.
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.
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.
learn to write a sql statement that displays user defined views by querying information_schema.tables where table_type = 'VIEW' and excluding system schemas.
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.
Compare union and union all by showing how they combine data from two tables, with union removing duplicates and union all preserving them.
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 ...