C# Mastery Hub
Home
Challenges
Discussion
Lessons
Core Topics
C# Fundamentals
Console Applications
Classes & OOP
Windows Forms
ASP.NET Core
SQL Server
VS & SQL Connection
RDLC Reports
.NET MAUI
Getting Started
Getting Started
Website Development
SEO Guide
Security
Project Workflow
Extra Topics
Cloud & Deployment
AWS Cloud
Deployment
About
Contact
Test Your Knowledge
VS + SQL - Lesson 3: Insert / Delete / Update Quiz
Answer all questions to test your understanding
1
Which method executes a command that doesn't return any rows?
ExecuteScalar()
ExecuteNonQuery()
ExecuteReader()
ExecuteTable()
2
What is the biggest risk of using string concatenation in SQL queries?
It makes the code slower
SQL Injection attacks
It uses more memory
It's hard to read
3
What is the correct way to pass values to a SQL command?
String concatenation
Using SqlParameter with @@ParameterName
Directly in the query string
Using string interpolation
4
What does ExecuteNonQuery() return?
The number of rows affected
A DataReader
A DataTable
A scalar value
5
Which of these is a safe SQL command?
DELETE FROM Students WHERE StudentId = 5
DELETE FROM Students WHERE StudentId = ' + studentId
DELETE FROM Students WHERE StudentId = @@StudentId
DELETE FROM Students WHERE StudentId = {studentId}
Submit Quiz