WorksheetsMastering MySQL Basics
Total questions: 15
Worksheet time: 8mins
What SQL command is used to retrieve data from a database?
RETRIEVE
GET
SELECT
FETCH
Which SQL command is used to insert new records into a table?
ADD RECORDS
CREATE ENTRY
UPDATE TABLE
INSERT INTO
What is the purpose of the UPDATE statement in SQL?
To modify existing records in a table.
To delete records from a table.
To retrieve data from a table.
To create new tables in a database.
Which SQL command is used to delete records from a table?
DELETE
REMOVE
DROP
CLEAR
What does RDBMS stand for?
Relational Data Base Management System
Relational Database Management System
Remote Database Management System
Real-time Database Management System
Which of the following is an aggregate function in SQL?
INSERT
DROP
UPDATE
COUNT
What is the result of the COUNT() function?
The COUNT() function returns the average value of a column.
The COUNT() function provides the maximum value in a dataset.
The result of the COUNT() function is the total number of rows that meet the specified criteria.
The COUNT() function calculates the sum of all values in a table.
How do you select all columns from a table named 'students'?
GET * FROM students;
SELECT ALL FROM students;
SELECT * FROM students;
FETCH * FROM students;
What SQL clause is used to filter records?
SELECT
FILTER
WHERE
ORDER BY
Which SQL command is used to create a new table?
INSERT TABLE
MODIFY TABLE
CREATE TABLE
ADD TABLE
What is the purpose of the GROUP BY clause in SQL?
To group rows that have the same values in specified columns and perform aggregate calculations on them.
To sort rows based on specified column values.
To create new tables from existing data.
To filter rows that meet certain criteria.
How can you sort the results of a SELECT query?
Use the GROUP BY clause in your SELECT query.
Apply the FILTER function to your SELECT query.
Utilize the HAVING clause in your SELECT query.
Use the ORDER BY clause in your SELECT query.
What is a primary key in a database?
A primary key is a unique identifier for a record in a database table.
A primary key is a random identifier for a record in a database table.
A primary key is a duplicate identifier for multiple records in a database.
A primary key is an optional identifier for a record in a database table.
Which SQL function would you use to find the average value of a column?
COUNT()
MAX()
SUM()
AVG()
What does the term 'foreign key' refer to in RDBMS?
A foreign key is a type of index that speeds up data retrieval.
A foreign key is a unique identifier for a record in the same table.
A foreign key is a constraint that prevents duplicate entries in a table.
A foreign key is a field in a table that links to the primary key of another table, establishing a relationship between the two.
