Sql Practice Questions

SQL Practice Questions: Test Your Knowledge!

 

 

Which SQL clause is used to specify the number of rows to return?
FETCH
LIMIT
TOP
ROWNUM
What is the purpose of the SQL LAST_VALUE function?
To retrieve the first value within a partition
To retrieve the last value within a partition
To retrieve the nth value within a partition
To retrieve the average value within a partition
What is the purpose of the SQL IFNULL function?
To return a specified value if an expression is NULL, otherwise it returns the expression
To check if an expression is NULL
To return the first non-null value in a list of expressions
To replace NULL values with a specified value
What is the purpose of the SQL PIVOT operator?
To rotate rows into columns
To filter rows based on a condition
To join two or more tables
To aggregate data using multiple columns
What is the purpose of the SQL INSERT INTO statement?
To add new rows to a table
To update existing rows in a table
To delete rows from a table
To create a new table
Which SQL keyword is used to add a new column to an existing table?
ADD COLUMN
ALTER TABLE
MODIFY COLUMN
INSERT COLUMN
Which SQL function is used to perform a cumulative sum or running total?
SUM
RUNNING_TOTAL
CUMULATIVE_SUM
RUNNING_SUM
What is the purpose of data replication in the ETL process?
To create multiple copies of data for backup and disaster recovery
To remove duplicate records
To transform data from one format to another
To delete old data permanently
What is the purpose of the SQL EXPLAIN statement?
To show the execution plan of a query
To describe the structure of a table
To list all tables in a database
To display the privileges of a user
Which SQL statement is used to create a stored procedure?
CREATE PROCEDURE
MAKE PROCEDURE
BUILD PROCEDURE
NEW PROCEDURE
What is the purpose of data replication in the ETL process?
To create a backup of the source data
To create a copy of the target data for disaster recovery
To create a copy of the data for distribution to other systems
To create a copy of the data for testing purposes
What is the purpose of the JOIN clause in SQL?
To combine rows from two or more tables based on a related column
To filter the rows based on a condition
To sort the result set
To group the result set by one or more columns
Which SQL operator is used to perform pattern matching?
MATCH
PATTERN
COMPARE
LIKE
What does the SQL LEAD function do?
Accesses data from a subsequent row in the result set
Accesses data from a previous row in the result set
Calculates the running total of a set of values
Ranks rows within a partition
What is the purpose of the PERCENT_RANK function in SQL?
To calculate the percentile rank of a value within a partition
To calculate the cumulative distribution of a value within a partition
To calculate the relative rank of a value within a partition
To calculate the moving average of a numeric column within a partition
Which SQL function returns the day of the month from a date value?
DAY()
MONTH()
YEAR()
DATE()
Which SQL clause is used to sort the result set in ascending or descending order?
SORT BY
ARRANGE BY
ORDER BY
SEQUENCE BY
Which SQL statement is used to create a table with a columnstore index?
CREATE TABLE WITH COLUMNSTORE INDEX
COLUMNSTORE INDEX TABLE
CREATE COLUMNSTORE TABLE
TABLE WITH COLUMNSTORE INDEX
What is the purpose of the LIKE operator in SQL?
To check if a value is equal to a specified value
To compare two values for equality
To perform mathematical calculations
To perform pattern matching on string values
Which SQL operator is used to combine multiple conditions and return true if all of the conditions are true?
OR
NOT
ANY
AND
Score: 0/20