0% found this document useful (0 votes)
32 views17 pages

As CH 11 Part 1 Database and Data Modelling

The document discusses the fundamentals of databases and data modeling, focusing on the differences between flat-file and relational databases. It highlights the advantages of relational databases, such as reduced data redundancy and improved security, and explains SQL's role in database management through Data Definition Language (DDL) and Data Manipulation Language (DML). Additionally, it covers the importance of data dictionaries, access control, and referential integrity in maintaining data consistency and security.

Uploaded by

Fatima Sajid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views17 pages

As CH 11 Part 1 Database and Data Modelling

The document discusses the fundamentals of databases and data modeling, focusing on the differences between flat-file and relational databases. It highlights the advantages of relational databases, such as reduced data redundancy and improved security, and explains SQL's role in database management through Data Definition Language (DDL) and Data Manipulation Language (DML). Additionally, it covers the importance of data dictionaries, access control, and referential integrity in maintaining data consistency and security.

Uploaded by

Fatima Sajid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Chapter 11: Database and Data Modelling AS Computer 1

Science 9618/01

DATABASE
Amran Anwar
Database is an organized collection of interrelated data that follows certain rules and all records have
the same structure.
There are two types of databases, Flat-File Database and Relational Database

1. FLAT-FILE DATABASE
Data stored in discrete files on the computer that can be accessed, altered or removed by the
user. Flat-Files allow only a simple 2D structuring of data.

2. RELATIONAL DATABASE
Database where data are organized in one or more tables with relationships (links) between
them. It is managed by DBMS.

LIMITATIONS OF FLAT-FILE DATABASE


Flat–File systems tend to lead to: -
 separation and isolation of data
 duplication of data in different files; have to manually change each
 program - data dependency
 data is more inconsistent
 difficulty in changing applications programs
 Sorting must be done manually or must write a program
 No security over data. Users can access almost everything
 Data may be in different format; difficult to find and use
 Impossible for it to be multi-user

ADVANTAGES OF RELATIONAL DATABASES


 Data Redundancy Is Reduced or Avoided as the data is stored in separate linked tables. It also helps in
keeping the physical volume of data to minimum.

 Improved Data Consistency as it is easier to update data.

 Creation of Complex and Customized Queries and Reports is easy.

 No Program Data Dependency i.e. changes to the data structures do not affect the program.

 Improved Security as different access rights are granted to users, so that users can have different
‘views’ of data.

 Allows Concurrent Access while preventing two users to update the same record at the same time (called
record locking).

 Privacy of Data Is Maintained through usernames and passwords to keep confidential data secure.

 Simpler Data Retrieval through Queries that makes it easy to generate reports.

 Amending, Searching and Sorting Of Data Is Easier.

 Better Managed as validation code does not need to be present in all application programs.

SQL – STRUCTURED QUERY LANGUAGE

-1-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01
It is the standard programming language provided by a DBMS to support all the operations associated with a

DML.

1. Data Definition Language (DDL)


Amran Anwar
relational database such as data definition and modification. SQL is divided into categories such as DDL and

It is that part of the SQL that:


 Defines the structure of the tables, specify identifiers, data types and relationships.
 Is used to build, modify and remove the structure of tables and other database objects. (tables,
users and indexes)
 Can also define validation rules that the data must adhere to.

2. Data Manipulation Language (DML)


It is that part of the SQL that:
 Allows the user to insert, delete and update data in database.
 Allows the user to query the database according to specified criteria.
 Allows the database to be sorted.

DBMS FACILITIES/FEATURES
1. Basic database design including tables, relationships and queries.
2. It provides a data dictionary.
3. DDL and DML for creating and using the database.
4. Backup of the database.
5. Software tools such as query processor and developer interface
6. Control of multi-user access to the data.

DATA DICTIONARY
 A table holding information about the database (metadata about the data).
 It maps logical database to physical storage.
 Allows existence check on data to be carried out.
 It also includes rules about data integrity for all attributes.

WHY ACCESS TO THE DATA IN A DATABASE NEEDS TO BE CONTROLLED


1. Information regarding the entities is sensitive and needs to be confidential
2. Certain data needs to be restricted to certain users only
3. To avoid concurrent updates of the same record

HOW ACCESS TO THE DATA BE CONTROLLED IN A DATABASE


1. Data in the tables can be encrypted
2. Access rights can be granted to users of the database as they dictate what the user is allowed to do /
see
3. Access rights may determine the HCI provided to the user
4. Different groups of users can be set up with the same access rights / privileges

DATABASE SCHEMA

-2-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01
A database schema defines how data is organized within a relational database; this is inclusive of

Amran Anwar
logical constraints such as, table names, fields, data types and the relationships between these
entities.

The different levels of the schema of a database are:


1. Logical
2. Physical / Internal
3. Conceptual
4. External

LOGICAL SCHEMA
A data model for a specific database that is not specific to one DBMS (independent of any particular DBMS). It is
the overview of a database structure that is used to build that database.

It is a feature that describes the relationship between data and its structure.
It models the problem / situation by using methods such as an ER diagram to show the structure of
the database and its relationships.

DIFFERENT LEVELS OF THE SCHEMA OF A DATABASE


1. External
 The individual’s view(s) of the database

2. Conceptual
 Describes the data as seen by the applications making use of the DBMS
 Describes the ‘views’ which users of the database might have

3. Physical / Internal
 Describes how the data will be stored on the physical media

4. Logical
 Describes how the relationships will be implemented in the logical structure of the
database

QUERY PROCESSOR
The query processor allows a developer (user) to perform searches to find specific (extract) data from the
database by entering the criteria as per requirement.

It is part of the DBMS that processes and executes queries written in structured query language
(SQL).

PURPOSE OF A QUERY PROCESSOR IN A DBMS


 Allows the user to enter criteria by creating SQL queries
 Searches for the data that meets the entered criteria, e.g. all boys in the school
 To perform calculations on extracted data, e.g. number of students with an A grade
 Organises the results to be displayed to the user (grouping or sorting)

-3-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01

DEVELOPER INTERFACE
Amran Anwar
A developer interface provides developers with the commands required for definition, creation and
manipulation of a database.
It enables a developer to create items such as tables and user-friendly forms and reports.

TASKS PERFORMED USING THE DBMS DEVELOPER INTERFACE


 Create a table
 Set up relationships between tables
 Create / design a form, e.g. to enter new student details
 Create / design a report, e.g. test result of the class
 Create / design a query (NOT run a query)
 Create interactive features e.g. buttons and menus

EXPLAIN WAYS IN WHICH THE DEVELOPER INTERFACE OF A DBMS WILL HELP THE TEACHER SET UP THE
DATABASE
The teacher can ...
 Set up forms for the input of student data
 Add objects to a form to make data input easier, e.g. drop-down boxes
 Design a report for the output of student marks
 Add a menu to select options for different actions

DATA DICTIONARY
A DBMS uses a data dictionary that contains data about the structure of the database. It is used to
store the metadata for a database (data about the data in the database). It includes:
 details of all the definitions of tables and attributes (names and data types)
 relationships between tables and any indexing
 primary and foreign keys
 validation rules used for the entry of data
 contains data about the physical storage of the data

Data Dictionary is a set of data that contains metadata (data about other data) about a database.
Data Dictionary is a file or table containing all the details of the database design.
The use of a data dictionary improves the integrity of the data stored, helping to ensure that it is
accurate, complete and consistent.
An important feature of the DBMS is the data dictionary which is part of the database that is hidden
from view from everyone except the DBA.

EXAMPLES OF ITEMS TYPICALLY FOUND IN DATA DICTIONARY


Three items that are stored in a data dictionary
 Table names
 Field names // Attribute names
 Data Types
 Type of validation rule used
 Primary Keys
 Foreign Keys
 Relationships
 Details on how the physical storage is organised

-4-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01
IDENTIFY THE PURPOSE OF ITEMS STORED IN A DATA DICTIONARY



Table names ...
... to identify the tables
Field / Attribute names …
Amran Anwar
 … to store the names of fields so they cannot be repeated in a table
 Data types ...
 ... to prevent the wrong data type being entered in a field
 Validation rule …
 … to ensure that data entered is sensible
 Primary key …
 … to uniquely identify each record in a table
 Foreign keys ...
 ... to link tables // to create relationships between tables
 Passwords ...
 ... to allow access only to authorised personnel
 Access rights ...
 ... for different levels of access

HOW USING A RELATIONAL DATABASE HAS OVERCOME PREVIOUS PROBLEMS ASSOCIATED WITH A
FILE-BASED APPROACH?
1. By storing data in (separate) linked tables data redundancy is reduced.
2. Fields can be added or removed without any effect on existing programs (that do not use these fields).
3. Unwanted or accidental deletion of linked data is prevented as the DBMS will flag an error.
4. Changes made to the structure of the data have little effect on existing programs.
5. Complex queries can be more easily made as the DBMS has a query language SQL.
6. Security / privacy of the data is improved as each application only has access to the fields it needs.
7. There is better control of data integrity as the DBMS performs validation checks on data entered (by
using its Data Dictionary).
8. Data Integrity issues are reduced as data only needs to be updated once / is only stored once.

WAYS IN WHICH THE DATABASE ADMINISTRATOR (DBA) COULD USE THE DBMS SOFTWARE TO
ENSURE THE SECURITY OF THE STUDENT DATA.
1. Issue usernames and passwords
 as it stops unauthorised access to the data
 encourage use of strong passwords and passwords should be changed on regular basis
2. Granting Access Rights / Privileges
 so that only relevant staff / certain usernames can read/edit certain parts of the data
 Access Rights can be read only (RO) / full access (RW)
 e.g. only class teachers can edit details of pupils in their class
3. Creating backups on regular basis (or as scheduled)
 in case of loss/damage to the original data, a duplicate copy of data can be made available
 e.g. backing up the attendance registers at the end of each day and storing the data off-site on a
removable storage device such as a flash memory
4. Encryption of data
 to make the data meaningless in case it is accessed by an unauthorized individual
 e.g. personal details of pupils are encrypted before being sent over the Internet to examination
boards
5. Usage monitoring / logging of activity...
 create an audit /activity log to record all accesses to the data by the different users
 e.g. Track who changed a student’s grade

REFERENTIAL INTEGRITY

-5-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01
It acts as a data integrity check that prevents the inconsistent data from being entered.

Amran Anwar
It will not allow the addition of a record in a linking table that has no record in the base/parent table. E.g. a
student’s marks cannot be entered in the Marks table if that student does have its record in the base/parent
table.

OR

It makes sure that if a record in the primary table is modified then all its related records in the other linking
tables will also be modified.

OR

It will not allow the deletion of a record that has related records present in other linking tables. E.g. a student’s
data cannot be deleted from its base/parent tables if that particular student has related records in other tables
such as Fees and Marks tables.

ROLLNO STUDENTNAME DATEOFBIRTH ADDRESS


0758 Asim Farooq 26-04-2006 24-Y-11 Madina Town


1126 Atifa Baig 11-12-2004 Canal Road

1359 John Paul 13-05-2004 TNT Satyana Road

STUDENTS TABLE

ROLLNO SUBCODE DATE MARKS


0758 2210 16-09-2016 71

1216 4024 13-09-2016 85

1359 2210 16-09-2016 39

MARKS TABLE

WHY REFERENTIAL INTEGRITY IS IMPORTANT IN A DATABASE

 Referential Integrity makes sure data is consistent


 Referential Integrity makes sure all data is up-to-date
 Referential integrity ensures that every foreign key has a corresponding primary key
 Referential Integrity prevents records from being added / deleted / modified incorrectly
 Referential Integrity makes sure that if data is changed in one place the change is reflected in
all related records - cascading update/delete
 Referential Integrity makes sure any queries return accurate and complete results
 Makes sure that data that does not exist cannot be referenced

SQL STATEMENTS

-6-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01
Data Types Used In SQL

DATA TYPE
Amran Anwar DESCRIPTION

Variable Length Character – used for string and


1 Varchar character values both. Need to specify its length as
well. Can store up to 255 characters. It uses 2 bytes.

Stores 0 or 1 or NULL value – used for Boolean


2 Bit
values.

Stores whole numbers, both +ve and –ve – used


3 Int
for Integer values. It uses 4 bytes.

Stores decimal and whole numbers, both +ve and


4 Real
–ve. It uses 4 bytes.

Stores any valid date values from 01-01-0001 to


5 Date
31-12-9999

Stores any valid time values using format


6 Time
hh:mm:ss

Data Definition Language – (DDL)


1. Create Database

Allow to create; a new database.

Syntax

CREATE DATABASE <database name>;

Example

CREATE DATABASE ‘StudentsManagementSystem’;

2. Drop Database

Allow the deletion of an existing database. Any information stored in the database will also be deleted.

Syntax

DROP DATABASE <database name>;

Example

DROP DATABASE ‘StudentsManagementSystem’;

-7-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01

3. Create Table

Allow to create; a new table within a database.


Amran Anwar
Syntax

CREATE TABLE <table name>


(
<attribute name 1> <data type>,
<attribute name 2> <data type>,
……………………
…………………..
<attribute name n> <data type>
);

OR
CREATE TABLE <table name>
(
<attribute name 1> <data type>,
<attribute name 2> <data type>,
……………………
…………………..
<attribute name n> <data type>,
PRIMARY KEY <(one or more attribute)>
);

Example

CREATE TABLE ‘StudentDetails’


(
RollNo varchar (4) NOT NULL ,
StName varchar (25) NOT NULL ,
DateOfBirth date NOT NULL ,
Age int NOT NULL ,
Address varchar (50) NOT NULL ,
PRIMARY KEY RollNo
);

Note:
 If PRIMARY KEY is not used in the above statement, then ALTER TABLE statement will
have to be used to add primary key as shown on the next page

 NOT NULL is a constraint (check)

4. Drop Table

Allow the deletion of an existing table. Any information stored in the table will also be deleted.

Syntax

DROP TABLE <table name>;

Example

-8-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01
DROP TABLE ‘StudentDetails’;

Amran Anwar
5. Alter Table

Allow to change the structure / design of an existing table in many ways. Some of them are listed below:

i. For Adding Primary Key


Syntax

ALTER TABLE <table name> ADD PRIMARY KEY <(one or more attribute)>;

Example

ALTER TABLE ‘StudentDetails’ ADD PRIMARY KEY RollNo;

ii. For Adding Foreign Key


Syntax

ALTER TABLE <table name> ADD FOREIGN KEY <(one or more attribute)>
REFERENCES <parent table name> <(one or more attribute);

Example

ALTER TABLE ‘Fees’ ADD FOREIGN KEY RollNo REFERENCES ‘StudentDetails’.RollNo;

iii. To Add a New Field


Syntax

ALTER TABLE <table name> ADD <attribute name> <data type>;

Example

ALTER TABLE ‘StudentDetails’ ADD MobileNo varchar (11);

iv. To Delete a Field


Syntax

ALTER TABLE <table name> DROP COLUMN <(one or more attribute)>;

Example

ALTER TABLE ‘StudentDetails’ DROP COLUMN Age;

v. To Change Data Type of Specified Field


Syntax

ALTER TABLE <table name> MODIFY COLUMN <attribute name> <data type>;

-9-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01

Example
Amran Anwar
ALTER TABLE ‘StudentDetails’ MODIFY COLUMN Age INT;

vi. To Add NOT NULL Constraint To a Field


Syntax

ALTER TABLE <table name> MODIFY <attribute name> <data type> NOT NULL;

Example

ALTER TABLE ‘StudentDetails’ MODIFY Age INT NOT NULL;

Data Manipulation Language – (DML)


1. Insert Into

Allow to create a new record in an existing table.

Syntax

INSERT INTO <table name> (<attribute name 1>, <attribute name 2>, ……….,
<attribute name n> ) VALUES (<value 1>, <value 2>, ………, <value n>);

Example

INSERT INTO ‘StudentDetails’ (RollNo, StName, DateOfBirth, Age, Address)


VALUES (‘1249’, ‘Ali Ahmed’, #13/11/2004#, 19, ’24-P, Sabrina Colony Fsd’);

2. Update

Allow to update an existing record in the specified table with the new data value.

Syntax

UPDATE <table name>


SET <attribute name> = <new value>
WHERE <attribute name> = <old value>;

Example 1

UPDATE ‘StudentDetails’
SET RollNo = ‘1244’
WHERE RollNo = ‘1249’;

Example 2

UPDATE ‘StudentDetails’
SET Age = 18
WHERE Age = 19 AND RollNo = ‘1249’;

Example 3

-10-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01
UPDATE ‘Runners’
SET StartDate = # 21-2-16 #
Amran Anwar
WHERE RunnerID = 6 AND TeamName = ‘Falcons’;

Example 4 (updates all records in a table with the two values specified)

UPDATE ‘Customers’
SET Address = ‘Pune’ , Salary = 1000;

3. Delete

Allow to delete an existing record in the specified table according to specified criteria.

Syntax

DELETE FROM <table name>


WHERE <condition>;

Example 1

DELETE FROM ‘StudentDetails’


WHERE RollNo = ‘0158’ ;

4. Select

Allow to fetch or filter records from existing table(s) according to specified criteria in many ways. Some of
them are listed below:

i. To Fetch All Records From a Specified Table


Syntax

SELECT * FROM <table name>;


Example

SELECT * FROM ‘StudentDetails’;

ii. To Fetch Specified Fields From a Specified Table


Syntax

SELECT <attribute name 1>, <attribute name 2>, ……, <attribute name n>
FROM <table name>;

Example

SELECT RollNo, StName, Address FROM ‘StudentDetails’;

iii. To Fetch Specified Fields From a Specified Table According To Given Criteria
Syntax

SELECT <attribute name 1>, <attribute name 2>, ……, <attribute name n>
FROM <table name> WHERE <condition>;

-11-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01

Example
Amran Anwar
SELECT RollNo, StName, Address FROM ‘StudentDetails’ WHERE Age = 16;

WHERE clause
It is used to:
 specify a condition while fetching data using SELECT statement
 modifying data using UPDATE statement
 deleting data using DELETE statement

Logical Operators used with WHERE clause


 AND  allows multiple conditions where all have to be TRUE
……. WHERE Gender = ‘Male’ AND Class = ‘6C’ ;
 OR  allows multiple conditions where at least any one has to be TRUE
……. WHERE Gender = ‘Male’ OR Class = ‘6C’ ;

Clauses used with WHERE clause


 LIKE  allow to search for a specified pattern. It compares given value with
similar values using % (present) and _ (any character)

……. WHERE StName LIKE ‘Ah%’ ; Shows all names starting with
‘Ah….’

……. WHERE StName LIKE ‘Sa_’ ; Shows all names like ‘Sam’ ,
‘Sai’ , ‘San’ etc.

Relational Operators used with WHERE clause


e.g. a= 10 , b = 20

= a = b is FALSE

!= a != b is TRUE

<> a <> b is TRUE

> a > b is FALSE

< a < b is TRUE

!< a !< b is FALSE

-12-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01

Amran Anwar
!> a !> b is TRUE

iv. To Fetch Specified Fields From a Specified Table According To Given Criteria (using relational
operators)
Syntax

SELECT <attribute name 1>, <attribute name 2>, ……, <attribute name n>
FROM <table name> WHERE <condition>;

Example

SELECT RollNo, MarksObt FROM ‘Marks’ WHERE MarksObt > 69;

v. To Fetch Specified Fields From a Specified Table According To specified pattern


Syntax

SELECT <attribute name 1>, <attribute name 2>, ……, <attribute name n>
FROM <table name> WHERE <condition>;

Example

SELECT RollNo, StName FROM ‘StInfo’ WHERE StName LIKE ‘Sa_’;

ORDER BY clause
It is used to sort data in ascending or descending order based on one or more columns.
Syntax

SELECT <attribute name 1>, <attribute name 2>, ……, <attribute name n>
FROM <table name>
ORDER BY <attribute name>;

Example 1

SELECT RollNo, StName, Address


FROM ‘StudentDetails’
Shows RollNo, StName and Address sorted
ORDER BY DateOfBirth ASC;
according to DatOfBirth in ascending order

Example 2

SELECT BandName, Venue


FROM ‘Bands’
Shows BandName and Venue sorted according to
ORDER BY BandName;
BandName in ascending order (Default Order)

-13-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01
Example 3

SELECT BandName, Venue


FROM ‘Bands’
Amran Anwar
Shows BandName and Venue sorted according to
ORDER BY BandName DESC;
BandName in descending order

Example 4

SELECT RollNo, StName, Address


FROM ‘StudentDetails’
Shows RollNo, StName and Address where Age is
WHERE Age = 17
ORDER BY DateOfBirth; equal to 17 and sorted according to DateOfBirth in
ascending order

GROUP BY clause
It is used to arrange identical data into groups
Example 1

SELECT RollNo, StName


FROM ‘StudentDetails’
Shows RollNo and StName gouped according to
GROUP BY Age;
Age. This ensures that Age is not repeated

Example 2

SELECT BandName
FROM ‘BandBooking’
Produces a list of Bands who have lined a gig. The
WHERE headlining = ‘Y’
GROUP BY BandName; group By clause ensures that the Band Names are
not repeated

INNER JOIN clause


It returns rows when there is a match in both tables.
Syntax

SELECT <table name 1>.<attribute name>, <table name 2>.<attribute name>


FROM <table name 1>
INNER JOIN <table name 2>
ON <table name 1>.<common attribute> = <table name 2>.<common attribute>;

The other different joins in SQL are given below, but are beyond the scope of A Level
syllabus.
 LEFT JOIN
 RIGHT JOIN
 FULL JOIN
 SELF JOIN

To Fetch Specified Fields From Two Tables According To specified ctiteria


Syntax

-14-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01

FROM <table name 1>


INNER JOIN <table name 2>
Amran Anwar
SELECT <table name 1>.<attribute name>, <table name 2>.<attribute name>

ON <table name 1>.<common attribute> = <table name 2>.<common attribute>;

Example

SELECT StInfo.RollNo, StInfo.StName, StFees.DOP FROM ‘StInfo’


INNERJOIN ‘StFees’
ON StInfo.RollNo = StFees.RollNo WHERE StFees.DOP = # 22-12-2020 #;

Example (without INNER JOIN)

SELECT StInfo.RollNo, StInfo.StName, StFees.DOP FROM ‘StInfo’, ‘StFees’


WHERE StInfo.RollNo = StFees.RollNo AND StFees.DOP = # 22-12-2020 #;

EXAMPLE OF GROUP BY
StInfo

RollNo StName Age DOB Mobile Email

1021 Ali Ahmed 14 21-08-11 03336519785

1139 Sana Abrar 11 5-6-07 03218956741 [email protected]

1287 M Hafeez 14 9-04-11 03008978961 [email protected]

1698 ………. 7 ……. ……… ……….

1696 ……… 11 1-1-10 ……….. …….

1784 ……… 14 20-11-07 ………… ……….

1855 …….. 14 9-5-07 ………… …….

-15-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01
SELECT RollNo, StName, Age FROM ‘StInfo’ GROUPBY Age ORDERBY DOB;

7
Amran Anwar
1698 …………
11
1139 Sana abrar
1696 ………….
14
1855 ………….
1784 ………….
1287 M Hafez
1021 Ali Ahmed

GLOSSARY
Attribute (Field) Flat File
Data item recorded in database design, e.g. the File of data records, as used by all applications
CustomerName attribute in the Customer table. before the arrival of relational database software.
Candidate key Flat-File Database
Any attribute or combination of attributes that can Data stored in discrete files on the computer that
qualify or act as a unique (primary) key can be accessed, altered or removed by the user.

Database Foreign key


Collection of related data where all records have the Attribute(s) in a table that link to a primary key in
same structure. another table to form a relationship.
OR
Data Dictionary Attribute in a table that links back to the same
A file/table containing all the data about the detail of attribute in another table; the primary key–foreign
the database design. key link forms a relationship between the tables.
Data Integrity Indexing
Data design features to ensure the validity of data in In database software, creating a secondary key on
the database. an attribute to provide fast access when searching
on that attribute; the indexing data must be updated
Data Item when the table data changes.
A single data value.

-16-
Chapter 11: Database and Data Modelling AS Computer 1
Science 9618/01
Data Security

Amran Anwar
Primary Key
Methods of protecting the data including the uses of
Attribute or combination of attributes that is used to
passwords and different access rights for different
uniquely identify a record.
users of the database.
Primary Key
Dependency
In database software, an attribute (or combination of
In relational databases, a non-key attribute that is
attributes) chosen to ensure that all records in a
not fully dependent on the primary key.
table are unique.

Data Dictionary Record (Tuple)


File that is part of the DBMS those stores a Collection of items (fields) relating to the same
description of the data held in a database. object and treated as a single unit for processing.

Data Definition Language (DDL) Relational Database


In database software, SQL statements that allow the A Database where data are organized in one or more
creation of a database. tables with relationships between them.
Database Management System (DBMS)
Relationship
Software that provides a layer between software
Link between two database tables made using a
that manages the databases and the application
primary key and foreign key.
programs that access the data.
Data Manipulation Language (DML) Secondary Key
In database software, SQL statements that allow Index created for an attribute in a database table
querying of a database and insertion, amendment that allows the data to be accessed fast in an order
and deletion of data. other than the primary key field order.
Entity
In database design, something about which we store Structured Query Language (SQL)
data, whether living or non-living. e.g. a customer. Industry-standard data description language and
OR data manipulation language used by database and
Any object, person or thing about which it is possible database management software.
to store data.
Table
Dataset organised in rows and columns; the columns
File
form the structure and the rows form the content.
Collection of data items those are stored under a file
OR
name.
In relational database software, a table is the
implementation of an entity in the problem.

-17-

You might also like