W3. SQL Syntax Flashcards
Q: What are SQL statements?
A: Actions performed on a database, made up of easy-to-understand keywords.
Q: Provide an example SQL statement to select all records from the “Customers” table.
A: SELECT * FROM Customers;
Q: What is a database table?
A: A structure that holds data in rows (records) and columns (fields), identified by a unique name (e.g., “Customers”).
Q: In the “Customers” table, what are some examples of columns (fields)?
A: CustomerID, CustomerName, ContactName, Address, City, PostalCode, and Country.
Q: How many records are shown in the “Customers” example table?
A: Five records, one for each customer.
Q: Are SQL keywords case-sensitive?
A: No, SQL keywords are not case-sensitive (e.g., select is the same as SELECT).
Q: Why might a semicolon be used at the end of an SQL statement?
A: To separate multiple SQL statements when executed in the same call; it’s standard in some database systems.
Q: List some of the most important SQL commands and their functions.
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