






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







● A Database is an organised collection of data ● A database is made up of either one or multiple tables which are made up of fields and records to organise how it stores data ● It allows easy storage, retrieval, and management of information ● A database is useful when working with large amounts of data, databases are stored on secondary storage ● A database is often stored on remote servers so multiple users can access it at the same time, useful for online systems ● Data can be sorted and searched efficiently, making use of more advanced structures ● They are more secure than text files
● A field is one piece of information relating to one person, item or object ● A field is represented in a database by a column, ● A record is a collection of fields relating to one person, item or object ● A record is represented in a database by a row
● A text file is useful when working with small amounts of data, text files are stored on secondary storage and 'read' into a program when being used ● They are used to store information when the application is closed ● Each entry is stored on a new line or separated with a special identifier, for example, a comma (',') ● It can be difficult in text files to know where a record begins and ends
● When a table is created, validation rules can be assigned to the different fields ○ A validation rule controls what data can be entered into that field ○ There are different types of validation checks used to limit what data can be entered into each field ○ The validation checks that are used are the same as those that appear in section 7: Algorithm Design & Problem-Solving
Describe two validation checks that could be used to check data being inputted into the table above [4] How to answer this question This Answer StudentID could have a length check to ensure 7 characters are entered [2] FirstName and LastName could have a presence check to make a record cannot be entered without entering the name of the student [2] A type check of boolean could be applied to the Mark Submitted field so that only Y or N are entered [2] A range check could be assigned to the Mark column to ensure only numbers between 0 and 100 are entered [2]
● A data type is the type of data that can be held in a field and is defined when designing a table ● Examples of common datatypes are: ○ Integer - whole number ○ Real - decimal number ○ Text/alphanumeric - text data ○ Character - single ○ Date/Time ○ Boolean - true or false values ● In the tablecars below, the following datatypes would be used: ○ car_id: integer ○ make: text/alphanumeric ○ model: text/alphanumeric ○ colour: text/alphanumeric ○ price: real
● A primary key is a unique field that can be used to identify a record in a table ● customer_id is the primary key for the customers table below ● Other examples of primary keys in database tables would include: ○ Student_ID in a school database ○ Car_Registration in a car database ○ Product_ID in a shop database
● The use of SQL allows a user to: ○ Select data ○ Order data ○ Sum data ○ Count data
● Select all the fields from the Customers table
Worked Example Below is a table of animals calledtbl_animals Complete this SQL statement to display all of the animal breeds that are currently breeding and there was only one young born this year [3] SELECT ................................................. FROM ................................................. WHERE .................................................
Answer SELECT Animal [1] FROM tbl_animals [1] WHERE Number of Young == 1 [1]