1/58
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What does SQL stand for?
Structured Query Language
Which of the following is a primary use of SQL?
Querying data efficiently
Is a language used to interact with relational databases.
SQL
Which type of SQL command is used to modify data in a database?
DML (Data Manipulation Language)
Which SQL command type is used to define the database structure?
DDL (Data Definition Language)
The SELECT command falls under which category?
DQL (Data Query Language
Which SQL command type controls access to the database?
DCL (Data Control Language)
Which of the following is an example of a DDL command?
CREATE
Which of the following is an example of a DML command?
UPDATE
Which of the following is an example of a DCL command?
GRANT
Which SQL command type is used for querying data?
DQL (Data Query Language)
Is a free, feature-rich edition of SQL Server designed for
learning, developing, and powering desktop, web, and small server applications
Microsoft SQL Server 2022 Express
It allows users to access, configure, administer, monitor, and develop SQL components,
generate and execute Transact-SQL (T-SQL) queries, view and edit data, and manage
databases through a graphical interface and script editors.
SQL Server Management Studio (SSMS)
What does SSMS stand for?
SQL Server Management Studio
What is the primary function of SSMS?
To generate and execute Transact-SQL (T-SQL) queries and manage databases
When connecting via SSMS, what should the "Server type" be set to?
Database Engine
For a local SQL Server Express instance, what is the typical "Server name"?
localhost\SQLEXPRESS
What is the typical "Authentication" mode used when connecting via SSMS in the module?
Windows Authentication
True or False:
SQL keywords are case-sensitive.
False
According to the module's conventions, how should SQL keywords be written for better readability?
UPPERCASE
How should a SQL statement be terminated in a script?
With a semicolon (;)
How should string or text values be enclosed in a SQL statement?
Single quotes (')
What is the purpose of the SELECT clause?
To specify the columns to display
What is the purpose of the FROM clause?
To specify the table to retrieve data from
What is the purpose of the WHERE clause?
To filter rows based on a condition
What is the purpose of the ORDER BY clause?
To sort the results
In which order must these clauses appear in a SQL query?
SELECT, FROM, WHERE, ORDER B
Which symbol is used for a single-line comment in SQL?
--
Which symbols are used for a multi-line comment in SQL?
/* and */
What is the correct SQL command to create a database named UniversityDB?
CREATE DATABASE UniversityDB;
After creating a database, what command is used to start working with it?
USE
The IDENTITY(1,1) property in a column definition means:
The column will auto-increment, starting at 1 and incrementing by 1.
What keyword defines a column that uniquely identifies each row in a table?
PRIMARY KEY
In the Enrollments table, what does the StudentID INT FOREIGN KEY REFERENCES Students(StudentID) line do?
It creates a link between the Enrollments and Students tables, ensuring a valid StudentID.
According to the lab activity, what is another way to create a table without running a SQL command?
Using the Object Explorer Window in SSMS
Is this SQL statement correct for inserting a new product?
INSERT INTO Products (ProductName, Category, Price)
VALUES ('Smartphone', 'Electronics', 20999.00);Correct
Is this SQL statement correct for inserting a new product?
INSERT INTO Products (ProductName, Category, Price)
VALUES (Smartphone, Electronics, 20999.00);Incorrect
What is the correct SQL command to view all records from the Products table?
SELECT * FROM Products;
True or False:
The WHERE clause is used to filter columns.
False
You want to find all products with a Quantity greater than 10. Which query is correct?
SELECT * FROM Products WHERE Quantity > 10;
You want to find all products in the 'Electronics' category. Which query is correct?
SELECT * FROM Products WHERE Category = 'Electronics';
You want to find all products added on or after September 1, 2025. Which query is correct?
SELECT * FROM Products WHERE DateAdded >= '2025-09-01';
The AND operator is used to retrieve records where...
All specified conditions are true.
The OR operator is used to retrieve records where...
At least one of multiple conditions is true.
You want to find products with a Quantity greater than 5 AND a Price less than 5000. Which WHERE clause is correct?
WHERE Quantity > 5 AND Price < 5000
You want to find products that are in either the 'Electronics' or 'Office' category. Which WHERE clause is correct?
WHERE Category = 'Electronics' OR Category = 'Office'
The NOT operator is used to...
Negate a condition.
You want to find all products that are not in the 'Accessories' category. Which query is correct?
All of the above are correct.
The LIKE operator is used for...
Pattern matching with wildcards.
The % wildcard in a LIKE pattern represents...
Any sequence of zero or more characters.
You want to find all suppliers whose name starts with 'Tech'. Which WHERE clause is correct?
WHERE Supplier LIKE 'Tech%'
You want to find all product names that contain the letter 'o'. Which WHERE clause is correct?
WHERE ProductName LIKE '%o%'
The IS NULL operator is used to check for...
Missing or undefined values
You want to find all products where the Supplier information is missing. Which query is correct?
SELECT * FROM Products WHERE Supplier IS NULL;
The IN operator is used to...
Check if a value matches any value in a list.
You want to find products in the 'Office' or 'Accessories' category. Which WHERE clause is correct using IN?
WHERE Category IN ('Office', 'Accessories')
The BETWEEN operator is used to...
Check if a value is within a specified range (inclusive).
Which operator means "Not Equal To"?
<> or !=
Which operator checks if a value is less than or equal to another?
<=