NEW
Font size
WorksheetsFinal Examination (Info Mgt)
Total questions: 60
Worksheet time: 30mins
Which SQL statement is used to create a table named Customers?
MAKE TABLE Customers
ADD TABLE Customers
CREATE TABLE Customers
NEW TABLE Customers
What keyword is used to automatically generate values for a primary key?
UNIQUE
NOT NULL
AUTO_INCREMENT
DEFAULT
Which data type is best used for storing names with variable length?
CHAR
INT
DATE
VARCHAR
Which constraint ensures that a column cannot have NULL values?
UNIQUE
NOT NULL
CHECK
DEFAULT
Which SQL statement is used to insert data into a table?
ADD INTO
PUT INTO
INSERT INTO
INPUT INTO
Which INSERT statement allows specifying selected columns only?
INSERT ALL
INSERT VALUES
INSERT INTO table (columns)
INSERT FULL
What happens if a NOT NULL column is not given a value during INSERT?
It inserts zero
It inserts blank
An error occurs
It inserts NULL automatically
Which symbol separates multiple rows in an INSERT statement?
Semicolon
Colon
Period
Comma
What is the purpose of a PRIMARY KEY?
To store text
To allow duplicate values
To uniquely identify each record
To format data
Which column type is most suitable for postal codes?
INT
DATE
VARCHAR
FLOAT
Which SQL command modifies existing records?
CHANGE
UPDATE
MODIFY
ALTER
What keyword specifies the condition in an UPDATE statement?
SET
WHERE
FROM
FILTER
What happens if UPDATE is executed without a WHERE clause?
Only one row updates
No rows update
All rows are updated
The query fails
Which SQL statement removes records from a table?
DROP
REMOVE
DELETE
CLEAR
What does DELETE FROM table; do?
Deletes the table structure
Deletes one row
Deletes all records
Deletes selected columns
Which clause is required to delete specific records only?
SET
FILTER
WHERE
LIMIT
Which command permanently removes a table including its structure?
DELETE
REMOVE
DROP
CLEAR
Which statement increases all prices by a value?
UPDATE price = price + 100
UPDATE table SET price = price + 100
SET price + 100
ADD price + 100
What is the result of deleting records with a WHERE condition?
All rows deleted
Table removed
Only matching rows are deleted
No rows deleted
Which SQL keyword modifies column values?
WHERE
FROM
SET
SELECT
Which operator is used to check equality?
:=
===
=
<>
Which operator selects values greater than a number?
<
<=
>
!=
Which keyword excludes a value from the result?
EXCEPT
NOT IN
REMOVE
OUT
Which operator is used to combine multiple conditions that must all be true?
OR
NOT
AND
BETWEEN
Which operator returns results if at least one condition is true?
AND
OR
NOT
XOR
What does BETWEEN do?
Matches text
Sorts data
Selects values within a range
Joins tables
Which keyword is used for pattern matching?
MATCH
FIND
LIKE
SEARCH
Which wildcard represents any number of characters?
_
#
*
%
Which wildcard represents exactly one character?
%
*
_
?
Which query finds names starting with "A"?
LIKE '%A'
LIKE '%A%'
LIKE 'A%'
LIKE '_A%'
Which query finds names ending with “s”?
LIKE 's%'
LIKE '%s'
LIKE 's'
LIKE '_s'
Which query finds names containing “en”?
LIKE 'en%'
LIKE '%en'
LIKE '%en%'
LIKE 'en'
Which condition checks multiple values?
BETWEEN
IN
LIKE
EXISTS
What does DISTINCT do?
Sorts data
Groups data
Removes duplicate values
Counts rows
Which clause limits the number of rows returned?
WHERE
LIMIT
ORDER
GROUP
Which keyword sorts results?
FILTER
GROUP
ORDER BY
SORT
Which keyword sorts data in ascending order by default?
DESC
ASC
UP
LOW
Which function returns the smallest value?
MAX()
COUNT()
MIN()
AVG()
Which function returns the largest value?
COUNT()
AVG()
MAX()
SUM()
Which function counts the number of rows?
SUM()
COUNT()
AVG()
TOTAL()
Which function calculates the total?
ADD()
TOTAL()
SUM()
COUNT()
Which function calculates the average?
MEAN()
TOTAL()
AVG()
ROUND()
Which clause groups records with the same value?
ORDER BY
DISTINCT
GROUP BY
HAVING
Which clause filters grouped results?
WHERE
HAVING
LIMIT
ORDER
Which clause works with aggregate functions?
WHERE
HAVING
LIMIT
JOIN
What happens if HAVING is used without GROUP BY?
Error
Ignored
Works with aggregates only
Deletes data
Which function rounds numbers?
FORMAT()
FIX()
ROUND()
CEIL()
What does ROUND(12.56,1) return?
12
12.5
12.6
13
Which keyword renames a column in output?
NAME
RENAME
AS
ALIAS
What is an alias used for?
Delete columns
Modify tables
Temporary column naming
Join tables
Which function converts text to uppercase?
LOWER()
CAPITAL()
UPPER()
TEXT()
Which function converts text to lowercase?
UPPER()
LOWER()
SMALL()
TEXT()
Which function combines strings?
JOIN()
MERGE()
CONCAT()
ADD()
What does CONCAT_WS do?
Concatenates without spaces
Concatenates with a separator
Removes spaces
Splits text
Which function counts characters in a string?
SIZE()
COUNT()
LENGTH()
CHAR()
Which function extracts part of a string?
SPLIT()
CUT()
SUBSTRING()
MIDTEXT()
Which CASE statement is used for?
Looping
Sorting
Conditional logic
Formatting tables
CASE is similar to which programming concept?
Loop
Function
IF–ELSE
Array
Which CASE condition runs first?
ELSE
LAST
First matching WHEN
All WHEN
What happens if no CASE condition is met?
Error
NULL
ELSE value is used
Query stops
