Understanding MySQL and SQL Concepts

Understanding MySQL and SQL Concepts

12th Grade

10 Qs

quiz-placeholder

Similar activities

DBMS Quiz

DBMS Quiz

11th - 12th Grade

10 Qs

Databases

Databases

10th Grade - University

15 Qs

MySQL

MySQL

11th - 12th Grade

15 Qs

Introduction to SQL (Grade 12)

Introduction to SQL (Grade 12)

11th - 12th Grade

15 Qs

SQL WILDCARDS

SQL WILDCARDS

10th - 12th Grade

9 Qs

MySQL Python Connectivity

MySQL Python Connectivity

12th Grade - University

10 Qs

Learning SQL

Learning SQL

11th - 12th Grade

15 Qs

2da Prueba_5to Aplicaciones_2023-2024

2da Prueba_5to Aplicaciones_2023-2024

12th Grade

10 Qs

Understanding MySQL and SQL Concepts

Understanding MySQL and SQL Concepts

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Bhuvi Eswari

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between MySQL and SQL?

MySQL is a programming language; SQL is a database.

SQL is a type of software; MySQL is a query language.

MySQL is a cloud service; SQL is a local database.

SQL is a language; MySQL is a database management system that uses SQL.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Write a SQL query to create a table called 'students' with columns 'roll_no', 'name', 'class', and 'marks'.

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

CREATE TABLE students (roll_no INT, full_name VARCHAR(100), class_name VARCHAR(50), total_marks DECIMAL);

CREATE TABLE learners (roll_no INT, name VARCHAR(100), section VARCHAR(50), marks INT);

CREATE TABLE students (roll_no INT, name VARCHAR(100), class VARCHAR(50), marks FLOAT);

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the PRIMARY KEY constraint in MySQL?

To group multiple records together in a table.

To uniquely identify each record in a table and enforce data integrity.

To automatically generate unique IDs for each record.

To define the data type of each column in a table.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Write a SQL query to insert data into the 'students' table.

UPDATE students SET age = 20 WHERE name = 'John Doe';

DELETE FROM students WHERE name = 'John Doe';

SELECT * FROM students WHERE name = 'John Doe';

INSERT INTO students (name, age) VALUES ('John Doe', 20);

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between DELETE and TRUNCATE commands in MySQL?

DELETE removes all rows and cannot be rolled back; TRUNCATE is row-specific and can be rolled back.

DELETE is row-specific and can be rolled back; TRUNCATE removes all rows quickly and cannot be rolled back.

TRUNCATE can be rolled back; DELETE cannot be rolled back.

DELETE is faster than TRUNCATE and is used for large datasets; TRUNCATE is slower and used for small datasets.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the role of foreign keys in relational databases.

Foreign keys are primarily used for data encryption.

Foreign keys are used to create indexes on tables.

Foreign keys enforce referential integrity between tables in a relational database.

Foreign keys allow for the duplication of data across tables.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Write a SQL query to update the marks of a student in the 'students' table.

UPDATE students SET marks = new_marks WHERE student_id = specific_id;

UPDATE students SET score = new_marks WHERE id = specific_id;

UPDATE students SET marks = specific_marks WHERE student_id = new_id;

UPDATE students SET marks = new_marks;

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?