W3. SQL Syntax Flashcards

1
Q

Q: What are SQL statements?

A

A: Actions performed on a database, made up of easy-to-understand keywords.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Q: Provide an example SQL statement to select all records from the “Customers” table.

A

A: SELECT * FROM Customers;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Q: What is a database table?

A

A: A structure that holds data in rows (records) and columns (fields), identified by a unique name (e.g., “Customers”).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Q: In the “Customers” table, what are some examples of columns (fields)?

A

A: CustomerID, CustomerName, ContactName, Address, City, PostalCode, and Country.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Q: How many records are shown in the “Customers” example table?

A

A: Five records, one for each customer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Q: Are SQL keywords case-sensitive?

A

A: No, SQL keywords are not case-sensitive (e.g., select is the same as SELECT).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Q: Why might a semicolon be used at the end of an SQL statement?

A

A: To separate multiple SQL statements when executed in the same call; it’s standard in some database systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Q: List some of the most important SQL commands and their functions.

A

SELECT - extracts data
UPDATE - updates data
DELETE - deletes data
INSERT INTO - inserts new data
CREATE DATABASE - creates a new database
ALTER DATABASE - modifies a database
CREATE TABLE - creates a new table
ALTER TABLE - modifies a table
DROP TABLE - deletes a table
CREATE INDEX - creates an index
DROP INDEX - deletes an index

How well did you know this?
1
Not at all
2
3
4
5
Perfectly