Search Header Logo

MySQL Quiz Class X

Authored by Alakesh Barua

Computers

10th Grade

Used 3+ times

MySQL Quiz Class X
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

50 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following commands creates a table named students with columns id (integer) and name (varchar)?

CREATE students TABLE (id INT, name VARCHAR(50));
CREATE TABLE students id INT, name VARCHAR(50);
CREATE TABLE students (id INT, name VARCHAR(50));
CREATE TABLE students (id TEXT, name INT);

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How would you create a table with a primary key on the id column?

CREATE TABLE example (id PRIMARY KEY INT);
CREATE TABLE example PRIMARY KEY (id);
CREATE TABLE example (id INT PRIMARY KEY);
CREATE example (id INT PRIMARY KEY);

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does the following query do? UPDATE employees SET salary = salary * 1.1 WHERE department = 'Sales';

Increases salary by 10% for all employees.
Increases salary by 10% for employees in the Sales department.
Does nothing.
Throws an error.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How can you update the name column in the students table to John for the row with id=1?

MODIFY students SET name='John' WHERE id=1;
CHANGE students name='John' WHERE id=1;
UPDATE students SET name='John' WHERE id=1;
SET students name='John' FOR id=1;

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the purpose of the SELECT statement?

To retrieve data from one or more tables.
To delete data from a table.
To insert data into a table.
To modify the structure of a table.

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which query retrieves all columns from the products table?

SELECT all FROM products;
SELECT * FROM products;
SELECT columns FROM products;
SELECT ALL COLUMNS FROM products;

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How can you add a new column email to the users table?

UPDATE users ADD COLUMN email VARCHAR(50);
ADD COLUMN email VARCHAR(50) TO users;
ALTER TABLE users ADD COLUMN email VARCHAR(50);
MODIFY users ADD email VARCHAR(50);

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?