Home / Notes / Class 10 / Computer Science / Databases
Data and information, the database and the database management system, tables, fields, records and keys, data types, relationships, queries, forms and reports, and basic SQL.
Data is a collection of raw facts such as names, numbers and dates. Information is data that has been processed and organised so that it has meaning. The marks of 40 students are data. The average mark of the class is information.
A database is an organised collection of related data that is stored so that it can be searched, updated and reported easily. A database management system (DBMS) is the software that creates the database and controls how data is stored, retrieved and protected. Microsoft Access, MySQL and Oracle are examples.
The parts of a database:
Data types. Each field has a data type that decides what can be stored in it. Common types are Text (names), Number (marks), Date/Time, Currency, Yes/No and Auto Number, which gives each new record the next number automatically. Choosing the right type saves space and prevents mistakes, for example a date field will not accept a name.
Relationships. In a relational database the data is kept in several tables that are linked. A student table and a class table can be linked by a common field. The primary key of one table appears in the other table as a foreign key. This avoids storing the same data twice, which is called redundancy.
Database objects in a program such as Microsoft Access:
Basic SQL. Structured Query Language (SQL) is used to ask questions of a database. SELECT chooses the fields, FROM names the table and WHERE gives the condition. For example, SELECT Name, Marks FROM Students WHERE Marks > 80; lists the name and marks of the students who scored above 80. ORDER BY sorts the result.
Advantages of a database over a paper file:
Study tip: For a database answer, name the table, the fields and the primary key first. Examiners give marks for a sensible choice of the key and the data types.
Say the meaning first, then open the card to check.
An organised collection of related data.
Software that creates and manages a database.
Data about one subject arranged in rows and columns.
A column in a table that holds one kind of data.
A row in a table that holds all the data about one item.
A field that has a unique value for every record.
A field in one table that is the primary key of another table.
A request to search for or select data that meets a condition.
The unnecessary repetition of the same data.
Structured Query Language, used to create, search and change data in a database.
These are the kind of questions asked for 2, 3 and 5 marks. Try each one before opening the answer.
Data is raw facts that have no meaning on their own, such as 45, 67 and 89. Information is data that has been processed and organised so that it is useful, such as the average mark of 67.
A primary key is a field whose value is unique for every record, so it identifies each record. The roll number in a student table is an example.
A field is a column in a table that stores one kind of data, such as the name. A record is a row that stores all the fields for one item, such as everything about one student.
Text, for a name such as Ayesha. Number, for marks such as 85. Date/Time, for a date of birth such as 12/05/2010. Other types are Currency and Yes/No.
SELECT Name FROM Students WHERE Class = 10; SELECT chooses the field, FROM gives the table and WHERE gives the condition.
Searching is fast, because a query can find a record in seconds. Data is stored once, so there is less duplication and fewer mistakes. Many users can use the same data at the same time. Passwords and access rights protect the data. Reports and totals can be produced automatically.