SQL Flashcards
What does SQL stand for?
Structured Query Language
True or False: SQL is a programming language used for managing relational databases.
True
Fill in the blank: The command used to retrieve data from a database is called _____.
SELECT
What is the basic syntax for a SELECT statement?
SELECT column1, column2 FROM table_name;
Which SQL command is used to insert new records into a table?
INSERT INTO
True or False: The DELETE command can be used to remove rows from a table.
True
What is the purpose of the WHERE clause in SQL?
To filter records based on specified conditions.
Multiple Choice: Which of the following is used to update existing records in a table? A) MODIFY B) UPDATE C) CHANGE
B) UPDATE
What is the syntax for creating a new table in SQL?
CREATE TABLE table_name (column1 datatype, column2 datatype, …);
Fill in the blank: To remove a table from a database, you use the _____ command.
DROP TABLE
True or False: SQL is case-sensitive.
False
What does the ORDER BY clause do?
It sorts the result set in either ascending or descending order.
What is the primary key in a database table?
A unique identifier for each record in a table.
Multiple Choice: Which SQL function is used to count the number of rows in a SELECT query? A) COUNT() B) SUM() C) TOTAL()
A) COUNT()
What is the purpose of the JOIN clause in SQL?
To combine rows from two or more tables based on a related column.