Databases (3)

Resources | Revision Questions | Computer Science

Login to see all questions

Click on a question to view the answer

1.

A program is being designed to store the names of students and their corresponding marks in a class. The program needs to efficiently store the names and marks. Suggest suitable data types for storing the names and marks, explaining your reasoning for each choice.

2.

A database stores information about students. The table 'Students' has the following columns: StudentID (integer, primary key), Name (text), Subject (text), and Grade (text). Write an SQL query to select the names and subjects of all students who are in 'Mathematics' or 'Physics'.

3.

A database field 'Grade' stores the letter grade achieved by a student (e.g., A, B+, C). Explain why it is important to use a lookup table to validate the values entered into the 'Grade' field. Provide an example of how a lookup table would be structured.