Free Online Flashcard Deck

3 SQL Fundamentals Free Online FlashCards

Study 3 SQL Fundamentals with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is SQL used for?

Back

SQL defines relational tables and retrieves information from the data they contain.

02
Front

What are the basic parts of a relational table?

Back

A table has named columns and rows. Each column has a data type suited to the values it stores.

03
Front

What does a primary key do?

Back

A primary key uniquely identifies each row. It can consist of one column or several columns.

04
Front

What does the NOT NULL constraint require?

Back

NOT NULL requires a column to have a value; it prevents missing values in that column.

05
Front

What does the UNIQUE constraint prevent?

Back

UNIQUE prevents duplicate values in the constrained column or columns.

06
Front

How does a CHECK constraint protect data?

Back

CHECK enforces a condition on values. For example, CHECK (price >= 0) prevents negative prices.

07
Front

What do SELECT and FROM specify in a basic query?

Back

SELECT names the columns to return, and FROM names the table to read. Use * to request all columns.

08
Front

What does WHERE do in a query?

Back

WHERE keeps only rows whose condition is true, such as rows with price < 25 AND in_stock > 0.

09
Front

How should a query test for a NULL value?

Back

NULL represents a missing or unknown value; it is not the same as zero or an empty string. Test it with IS NULL or IS NOT NULL.

10
Front

What does the IN operator check?

Back

IN matches a value against a list of alternatives, such as category IN ('Books', 'Games').

11
Front

How does ORDER BY affect query results?

Back

ORDER BY requests a result order. ASC is the default; DESC sorts in descending order. Without ORDER BY, row order is not guaranteed.

12
Front

What does LIMIT do, and why pair it with ORDER BY?

Back

LIMIT restricts the number of returned rows in many databases. Pair it with ORDER BY for a predictable selection.