The database program, the Terms table and SQL
Answers are for parents and teachers.
1
Write a SELECT that shows only Term and Defe of every record in Terms.
SELECT Term, Defe FROM Terms;
2
Write a command that removes only the term with id 1, and say what the command would do without the WHERE part.
DELETE FROM Terms WHERE id = 1; Without WHERE it would remove every record.
3
A table has the records 1 router, 2 cable, 3 browser. After INSERT with id 4 and DELETE of id 2, which ids are left?
1, 3 and 4.
4
Explain why the Picture field holds text and not a picture.
The picture is a file in the pic folder; the field stores its path so the page can ask for it.
5
Put the commands in a useful order for adding and checking a term: SELECT to check, INSERT to add. Why this order?
INSERT first, then SELECT: you can only check a record after it has been added.