WorksheetsMySql Basics
Total questions: 45
Worksheet time: 34mins
What is the full form of DCL?
Data Control Language
Data Central Language
Data Control Login
Data Central Login
MySQL is
open source software
dbms
spreadsheet software
none of the above
How can you add a column to an existing table in MySQL?
ALTER TABLE
MODIFY TABLE
UPDATE TABLE
ADD COLUMN
What does the COUNT function in SQL do?
Sums up values in a column
Returns the total number of rows
Finds the maximum value in a column
Returns distinct values in a column
What is the purpose of the GROUP BY clause in SQL?
Sorts data in a table
Filters records based on a condition
Groups rows sharing a property
Joins multiple tables
Which SQL clause is used to filter data after grouping it?
GROUP BY
HAVING
FILTER BY
WHERE
What does the MAX function return in SQL?
The maximum length of text in a column
The highest number of rows in a table
The largest numeric value in a column
The largest table size
What does DISTINCT do in an SQL query?
Sorts records
Filters records based on conditions
Returns unique records
Aggregates data into groups
What data type is used to store the password in the login_info table?
See Projector Screen
VARCHAR(255)
TEXT
CHAR(255)
BLOB
Which SQL command can be used to retrieve only the users who are marked as active?
See Projector Screen
SELECT * FROM login_info WHERE status = 'inactive';
SELECT * FROM login_info WHERE gender = 'male';
SELECT * FROM login_info WHERE status = 'female';
SELECT * FROM login_info WHERE status = 'active';
Which of the following will return all female users in the login_info table?
See Projector Screen
SELECT * FROM login_info WHERE gender = 'female';
SELECT * FROM login_info WHERE status = 'female';
SELECT * FROM login_info WHERE mobile LIKE 'female';
SELECT gender FROM login_info WHERE gender = 'female';
Which query can be used to update sanjay_k's status to active?
See Projector Screen
UPDATE login_info SET status = 'active' WHERE username = 'sanjay_k';
UPDATE status='active' WHERE username='sanjay_k';
UPDATE login_info WHERE username='sanjay_k' SET status='active';
UPDATE login_info status='active' WHERE username='sanjay_k';
How can you delete the record of the user vikas_r?
DELETE FROM login_info WHERE username='vikas_r';
REMOVE FROM login_info WHERE username='vikas_r';
DROP ROW FROM login_info WHERE username='vikas_r';
DELETE vikas_r FROM login_info;
Which SQL command will display all users sorted by their date_of_birth in ascending order?
See Projector Screen
SELECT * FROM login_info ORDER BY date_of_birth DESC;
SELECT * FROM login_info GROUP BY date_of_birth;
SELECT * FROM login_info ORDER BY date_of_birth ASC;
SELECT * FROM login_info WHERE date_of_birth ASC;
We use group by in column where
all values are unique
values are repeated
values are numbers
none of the above
Which mysql can be used to make column text to Upper case
uppercase
upper
capital
capitalcase
Which of these are not used as wild card character?
*
%
_
all can be used
