SQL Commands
Querying and Filtering
DataBase Concepts
SQL Joins and Relationships
Miscellaneous
100

The _______ statement is used to extract data from a database

SELECT

100

Logical operator used to compare a value greater than another value.

>

100

Application used to connect to SQL servers to query data

Microsoft SQL Server Management Studio.

100

What type of SQL join returns only the rows that have matching values in both tables involved?

INNER JOIN

100
What symbol represents WILDCARD?

%

200

The _________ statement is used to modify the existing records in a table

UPDATE

200

The _____ operator allows you to specify multiple values in a WHERE clause

IN

200

What is a primary key in a database table?

 It is a unique identifier for each row in a table.

200

What type of SQL join returns all the rows from the left table and the matching rows from the right table, and fills in NULL values for non-matching rows?

LEFT JOIN

200

What is a Subquery?

A subquery is a query within another query, also known as a nested query or inner query.  

300
This command is used to retrieve unique values from a column in a table.

DISTINCT

300

Table that contains column names for the database.

sys.syscolumns

300

What is a foreign key in a database table?

It is a column or set of columns that establishes a link between two tables.

300

What SQL keyword is used to combine multiple conditions in a join?

ON
300

What is the result from this query

Declare @Date datetime
SET @Date = '2024-05-10 00:00:00.00'
SET @Date = DATEADD(DAY,10,@Date)
Select @Date - 1

Select one:

a) 2024-05-09 00:00:00.000

b) 2024-05-20 00:00:00.000

c) 2024-05-19 00:00:00.000

d) I don't know


c) 2024-05-19 00:00:00.000


400

This command is used to group rows based on one or more columns and perform aggregate functions on each group.

GROUP BY

400

IsNull function, describe it's use

IsNull is used to specify a value when the expression is null

400
Name 3 out of the 4 numeric data types

tinyint, smallint, int, bigint

400

 In a many-to-many relationship, what type of table is used to connect the two main tables?

Join table or Bridge table

400

When using the "group by" clause, what columns should you include.

All columns in the SELECT clause that do not contain an aggregate function

500

This command is used to combine the result sets of two or more SELECT statements into a single result set.

UNION

500

Main difference between Union and Union All

UNION only returns unique record, while UNION ALL returns all the records including duplicates.

500

What is the result

select SUBSTRING(lastname,1,3) from Person p

where lastname= 'Matthew'


Select one:

a ) Mat

b) hew

c) thew

d ) Phone a friend

a ) Mat

500

What is the purpose of using aliases in SQL JOINS?

SQL aliases are used to give a table, or a column in a table, a temporary name. Aliases are often used to make column names more readable.

500

Who is this man?

Pinal Dave

M
e
n
u