Answer
Flashcards · 0478 · Topic 9
Databases flashcards
8 cards on Topic 9. Pick a subtopic or study them all.
Study mode needs JavaScript. Every card is listed below, so you can still cover the answers and test yourself.
Choose your cards
Session complete
Worth another look:
All 8 cards
For a quick read-through or printing. Cover the right-hand side to test yourself.
Topic 9: Databases
- Table, field and record
- A table holds data about one kind of thing. A field is a column holding one kind of fact. A record is a row holding all the facts about one item.
- What is a primary key?
- A field whose value is unique for every record, so each record can be identified. It cannot be left empty. An ID number is a good choice; a name is not, since two people can share one.
- Which database data types do you need for 0478?
- Text/alphanumeric, character, Boolean, integer, real, and date/time.
- Why is a telephone number stored as text, not an integer?
- It is never used in calculations, and a leading zero would be lost if it were stored as a number.
- What do SELECT, FROM, WHERE and ORDER BY do in SQL?
- SELECT lists the fields to show (* for all). FROM names the table. WHERE gives the condition records must meet. ORDER BY sorts the results, ascending by default, or descending with DESC.
- What do SUM and COUNT do in SQL?
- SUM adds up the values in a numeric field. COUNT counts the records that meet the condition. Each returns a single value.
- In what order must the clauses of an SQL query be written?
- SELECT, FROM, WHERE, ORDER BY. Text values go in quotation marks; numbers do not.
- Write SQL to show the Title of books by N Okafor priced under 10, from table Book
- SELECT Title FROM Book WHERE Author = 'N Okafor' AND Price < 10;