
Understanding MySQL and SQL Concepts

Quiz
•
Computers
•
12th Grade
•
Medium
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
Similar Resources on Wayground
10 questions
Programación de Base de Datos

Quiz
•
1st - 12th Grade
11 questions
@tbinh1768/TIN ĐS HK1

Quiz
•
11th Grade - University
12 questions
Câu hỏi về SQL

Quiz
•
11th Grade - University
8 questions
ASK T3 KOD ARAHAN 4.1.7

Quiz
•
12th Grade
10 questions
Technical Terms - Internet (A-Z) - NoSQL

Quiz
•
12th Grade
11 questions
MySQL Tutorial de Workbench

Quiz
•
12th Grade
10 questions
PhpMyadmin

Quiz
•
12th Grade
9 questions
H DDD - Aggregate functions (revision)

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade