A Flat file database. Problems with a flat file database (data redundancy)

Size: px
Start display at page:

Download "A Flat file database. Problems with a flat file database (data redundancy)"

Transcription

1 Data capture Before you can create a database, you need to collect data. This is known as data capture. One of the most common ways is to use and optical mark reader (OMR). An OMR sensor is used for marking multiple choice tests and for collecting the results of surveys or questionnaires. The user fills out a form, usually by shading in the box they wish to select. The OMR shines a light at the paper and as the shaded mark will reflect less light than empty boxes, signals are sent back to the computer system that identifies which box has been shaded. An algorithm interprets this so can work out which box is selected and the information stored in a database. An alternative to an OMR is an OCR (optical character recognition). Optical character readers are used to convert paper-based hardcopies of text into digital, editable copies of the same document. Alternatively, they are used so a computer can identify and interpret handwritten text. They work by scanning a hardcopy document and storing a picture. The optical character recognition software looks at each individual character and compares it to a database of characters to look up the possible value. Some algorithms work by pattern recognition and feature detection of characters. Once a match is found, the equivalent ASCII value is placed in a digital file. A Flat file database # A flat file database consists of just one file/table. It is suitable for storing smaller sets of data such as all the names and addresses of people at a sports club or all the information about a personal DVD collection. The main problem with these databases is that the larger they grow the more data becomes redundant. Data redundancy simply means having lots of replicated unnecessary data. Most databases, however are about more than just one entity. There are multiple relationships between the entities. For example, in a database about DVDs, you may wish to keep data on which of the main actors starred in each film. The actor would be a second entity alone. e.g. A Dentist s surgery with multiple dentists may have a system that allows patients to book appointments. Entities in the system are: Dentist, Patient, Appointment. The attributes of Dentist are: Title, First name, Surname, Qualification, Age, Surgery name. The attributes of Patient are: Title, First name, Surname, Date of birth, Address, Telephone, Medical conditions, Teeth on watch, Dentist history. The attributes of Appointment are: Dentist, Patient, Date, Cost, Time, Specific requirement Problems with a flat file database (data redundancy) If an item of data becomes outdated or needs to change then data redundancy may mean that the data has to be changed in numerous locations. This is not only time consuming but also means that it is easy to miss a record in the database. This leads to a loss of data integrity (data not reflecting the real world). This, in turn, could lead to legal problems with the Data Protection Act. Moreover, if we wanted to store extra information (another attribute) and there is data redundancy, the same data will have to be entered in numerous times. This increases the probability of entering invalid/inaccurate data by mistake.

2 Databases Database: An organised collection of data held in a computer system, especially one that is accessible in various ways. A relational database = a collection of tables in which relationships are modelled by shared attributes. A relation = A set of attributes and records, modelling an entity (a table). Data is stored in tables (called relations) and modelled by shared attributes. Databases store data in tables like the one below A table = a data structure that stores all the records for a particular category or person. A field = One specific piece of information about an entity. (i.e. the title of a column). Attribute = The properties, facts, details of characteristics which represent that entity (named column in table) A record: all of the data or information about one person or thing. Records stored as rows (horizontal). Small databases have very few records compared to a large company which has thousands to millions of records. e.g. Data is stored in the tables in records (rows), that can be divided into fields (columns). Each table must have its own primary key and name. Relational databases arrange data as sets of tables with linked or shred attributes through primary and foreign keys. The tables contain records (horizontal rows). Each record consists of several fields; the fields of all records form the columns. Examples of fields: name, gender, hair colour. e.g. Conceptually, one row of a table holds one record. Each column in the table holds one attribute (with many records of data about it).

3 Database concepts When a systems designer begins to work on a new proposed computer system, one of the first things they need to do is to examine the data that needs to be input, processed and stored and determine what the data entities are. Entity = A category of object, person, event or thing of interest to an organisation about which data (attributes) are to be recorded. Examples of such entities are Film, Actor, Product, Recipe, Ingredient and each entity has attributes. Entity Descriptions An entity description is usually written with the format: Entity1 (Attribute1, Attribute2,..) e.g. entity description for Appointment would be.. Appointment: Appointment( AppointmentID, Dentist, Patient, Date, Cost, Time, Specific requirement) AppointmentID = Primary Key Entity identifier and primary key Each entity requires an entity identifier to uniquely identify the entity. In a relational database, this is called a primary key. So far, none of the attributes of the entities identified so far (Dentist/Patient/Appointment) would be suitable. A unique ID such as D13649 should be used. o We use a numeric code or string o In the entity description, the primary key is underlined. Relational database keys In a relational database, a separate table is created for each entity identified in the system. Where a relationship exists between entities, an extra field (column) called foreign key links the two tables. Relationship = when tables within a database are related/linked so data can be accessed between them. One table has a foreign key that references the primary key of the other table. A primary key is composed of one or more attributes that uniquely identify a particular record in the table (when describing an entity, this is called an entity identifier). A foreign key is an attribute that creates a link between two tables. It is the attribute that is common to both tables and is used as a primary key in the other table it uniquely identifies.

4 A secondary Key (indexing) (a secondary key may not be unique to record) In order that a record with a particular primary key can be quickly located in the database, an index of primary keys is maintained by the database software. This will give the position of each record according to its primary key. One or more secondary indexes may be needed when the database is created, this is the case for any attribute that is often used as search criteria. E.g. Author and Title in a database that uses BookIDs as the primary key may be used as secondary keys. This would speed up searches on either of these fields, which would otherwise be searched sequentially. e.g. A patient is unlikely to know their patientid so a secondary index (e.g. surname) is likely. Indexing = An index is a data structure used to shorten the length of time it takes to search a database. It allows the user to gain access to specific records that are indexed in a file. For example, the index might contain the surname column of a database or even the column of primary keys. This would mean that when you are searching for a student, if you know their surname or primary key (StudentID), you can find the information you want much faster than if you were to sequentially sort through all the items. This is similar to a contents page. Sometimes you may not know the primary key but you do know the surnames of the students so you can use the index table (or indexing software) to quickly jump to the correct record. Linking database tables: Tables are linked through the use of common attributes. The attribute must be the primary key of one of the tables, and is known as a foreign key in the secondary table. Relationships between entities The different entities in a system may be linked in some way, and the two entities are said to be related. One-to-one (1:1): When one table (entity) is related to another using a common attribute as a primary and foreign key. Examples include the relationship between a Husband and Wife or Country and Prime Minister. Head teacher In charge of School One-to-many (1:n): When one table (entity) is related to multiple other tables (entities). This means that the (an attribute) primary key of the main table is used as a foreign key in multiple other tables (common attribute to many). Examples of relationships include Mother and Child, Customer and Order, Borrow and Library Book. Dentist treats Patient

5 Linking tables in a many-to-many relationship In this data model, we can t simply link two tables in a many to many fashions. An extra table is used linking say a Student and Course table. We could call this StudentCourse or Enrolment. The primary key of the Student table and of the Course table become foreign keys in the third enrollment table. They form what is known as a composite primary key. Composite primary key = a primary key consisting of more than one attribute. For the relationship between Student and Course: A student takes many courses that are also taken by many other students. In this case an extra table (e.g. Enrolment) is needed to link the two tables. The three tables could be described as: Student (StudentID, Name, Address) Enrolment (StudentID, CourseID) Course (CourseID, Subject, Level) The composite key consists of two attributes StudentID, CourseID NOTE: Entity name is held outside of these brackets Student takes Course Student Enrolment Course Drawing an entity relationship diagram Databases will regularly have many entities linked together so an entity relationship diagram is used to show all relationships. e.g. A hospital inpatient system may involve the entities Ward, Nurse, Patient, Consultant. A ward is staffed by many nurses but each nurses only staffs only one ward. A patient in a ward has many nurses looking after them and only one consultant that looks after them. The Consultant sees many patients on many wards. Ward Nurses Patient Consultant

6 Referential integrity Imagine a database with entities Product and Component It is important that when the tables are linked, a particular component is not deleted if it is used in a product in the Product table. This is known as referential integrity. Examiner tips The 'Many' side is usually the foreign key The 'One' side is usually the primary key Before you design or set up a database, you should work out: - the entities - the attributes - the entity relationships This process is called 'data modelling' Normalisation #Normalisation = a process used to devise the best possible design for a relational database. #Normalised entities = a set of entities that contain no redundant data #Referential integrity = If a value appears as a foreign key in one table then it must be a primary key of another table. Tables should ideally be organised in such a way that: LEARN THESE 4 POINTS 1. No data is unnecessarily duplicated (i.e. same data held in more than one table) 2. Data is consistent throughout the database (e.g. customer is not recorded as having different addresses in different tables of the database). Consistency should be an automatic consequence of not duplicating data. This means that no anomalies will arise when data is inserted, amended or deleted. 3. The structure of table is flexible enough to allow you to enter as many or as few items for an attribute in a record as required. 4. The structure should enable a user to make all kinds of complex queries relating to data from different tables. The relational database was invented by Dr Edgar F. Codd in The main disadvantage with relational databases is that they are more complicated to create and maintain

7 Normalisation of a database A serial database: Serial means that the data is in an ordered structure Sequential means the database is ordered by a particular field. E.g. ordering a database of people by surname (alphabetical) First normal form Rule 1: Eliminate duplicate columns from the same table and each field/column has one piece of data. Rule 2: Create separate tables for each group of related data (all attributes dependant on primary key) Rule 3: Identify a column or combination that will uniquely identify each of the records in a table. i.e. Define and create primary keys in each table. Second normal form Rule 1: Check the data is in first normal form. Rule 2: Remove any data sets that occur in multiple rows and transfer them to new tables. Rule 3: Only at second normal form will the relationships be created between the separate tables (old and new) by means of a foreign key. Third normal form Rule 1: Check the data is in second normal form. Rule 2: Remove any columns that are not dependent on the primary key. To remove a many-to-many relationship it is necessary to insert another entity (sometimes called a linking entity) that breaks the relationship into two one-to-many relationships. SQL language You need to be able to retrieve the data from a database. This is done through querying the database. A query = A search on the database allowing specified data to be extracted. Results are returned in the form of a new table or a report. In the early computing days, there were many different databases that each had a different way to query it. This meant it was difficult to transfer skills from one database to another. There was no standardisation so developers were locked into specific database implementations. SQL became the standard for querying a database. SQL = structured query language. A query written in SQL is sent to a database query engine as plain text.

8 How do we select data We use the command SELECT.. to retrieve either a record, column (field) or an entire table. e.g. let Students be a table in a database How do we narrow our selections We can use the WHERE command which will always come after the SELECT command. How do we sort our selections We can use the ORDER BY command to order the output. This will come after the FROM or WHERE commands. We write: ORDER BY field (to determine order) DESC If we leave out DESC then it will automatically order ascending. We can just write ORDER BY field SQL Description Result SELECT StudentID FROM Students This will retrieve the entire student ST6, ST7, ST8 ID column SELECT * FROM Students * Means retrieve all items Students table SELECT * FROM Students WHERE StudentID = ST7 This will retrieve all the items of the record ST7. It is defined by the ST7, Charlotte, 12/05/2000, F, CA80GH primary key ST7 SELECT * FROM Students WHERE Gender This returns all records where the ST7 and its fields = F SELECT Studentname, DOB FROM Students WHERE Gender = F SELECT Studentname FROM Students WHERE gender = F ORDER BY DOB DESC How to create a table We use the command: CREATE TABLE table_name ( PrimaryKey VARAIBLE, field1 VARAIBLE, field2 VARAIBLE, field3 VARAIBLE ) How to remove from a table We use the command: DROP table_name This will delete the table and all of its contents gender is female This returns the student name and date of birth for all the female students. This selects the students names who are female and it will display them in order of their date of birth descending ST8 and its fields Charlotte, 12/05/2000 Julie, 03/10/2000 Julie Charlotte It is also common practice to start a new line when using a new operator. E.g. SELECT * FROM Students

9 What variable type to use for each field? Data type Description Example CHAR(n) Character string of fixed length n ProductCode CHAR(n) VARCHAR(n) Character string of variable length, max, n ProductName VARCHAR(n) BOOLEAN TRUE or FALSE ReviewComplete BOOLEAN INTEGER, INT Integer values Quality INTEGER FLOAT (n,d) Real numbers (floating point decimal) with max of n digits and d decimal places Length FLOAT (10,2) DATE Dates in format dd/mm/yyyy HireDate DATE TIME Stores hour, minute, second values RaceTime TIME CURRENCY Formats the numbers in the currency used in your region ( pp.dd) EntryFee CURRENCY How to insert items into a table just created or an existing one SQL also lets you add records using the INSERT INTO. VALUES. command. INSERT INTO table_name (PrimaryKey, field1,field2, field3) VALUES ( id1, V1, V2, V3, PRIMARY KEY(id1)) Be aware that when inserting a record you must include a value for the primary key (in this case StudentID). If you try to insert a new record with the same primary key as an existing record, the database will reject the query. SQL CREATE Students(Student ID CHAR(3), Student name VARCHAR(12), DOB DATE, Gender CHAR(1), Postcode CHAR (7), PRIMARY KEY(Student ID) ) Description This will create a new table called students. The primary key is student id and is a string of fixed length (3 characters). Likewise, Student name is a field that is a variable string of maximum length 12 characters. DOB is a field of dates. Gender is a field of strings of fixed length 1 character. Postcode is a field of strings of fixed length 7 characters. We have to define primary key at the end. We can also define foreign keys here. Note these will have already been mentioned in this list. DROP Students INSERT INTO Students(Student ID, Student name, DOB, Gender, Postcode) VALUES ( ST6, James, #30/01/2000#, M, OX68TY ) Removes the student table and all items We use for CHAR (strings) and #...# for dates and just simply write integers as integers. This will insert into the students table a singular record that covers items in all fields. How to update items in a table We use the UPDATE.SET =.. Command to edit existing data in the database. SQL Description Result UPDATE Students SET StudentName = James UPDATE Students SET StudentName = Adam WHERE Student ID = ST6 This will edit all of the records under the field student name to have the same name James in the students table. This will change the record defined by primary key ST6 to have the student name Adam (opposed to the previous James All student names = James ST6, Adam, 30/01/2000, M, OX68TY

10 James Adam James James How to delete items from a table As well as adding and editing data, SQL also enables you to delete data from a database using the DELETE command. This uses similar syntax to the SELECT command SQL Description Result DELETE FROM Students WHERE This will delta every record with All student names = James StudentName = James student name James DELETE * FROM Students Deletes all items in the table but Empty table does not remove it DELETE DOB FROM Students Deletes the field DOB from the table Same table but without the field DOB We can also increase our specified location of the WHERE operator. If we want to search for something that we know has a pattern e.g. all the names beginning with the letter a. SELECT StudentName FROM Students WHERE StudentName LIKE a% You can use all the common logical operators You are familiar with in SQL statements, including Boolean operations such as AND, OR, NOT. SELECT StudentID, StudentName, Gender FROM Students WHERE DOB BETWEEN #01/04/1999# AND #31/07/2002# In this case it would return the StudentID, StudentName, Gender of all of our students in the table as they all have this range of DOB. DBSM = Database management system is a software application which handles a database at fundamental levels, allowing the database to interact with the user and other applications to: 1. Additional security to the database 2. Integrity to ensure efficiency and structure is not compromised 3. A manipulation language to access and change data (SQL) 4. An interface for other programs to access and use the data with program/data independence. I.e. there is no concern for the underlying structure. They are available for small systems on PC s and for huge systems for large organizations. Microsoft access is a DBMS and ORACLE is another DBMS.

Database Management Systems,

Database Management Systems, Database Management Systems Database Design (2) 1 Topics Data Base Design Logical Design (Review) Physical Design Entity Relationship (ER) Model to Relational Model Entity Relationship Attributes Normalization

More information

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data. Managing Data Data storage tool must provide the following features: Data definition (data structuring) Data entry (to add new data) Data editing (to change existing data) Querying (a means of extracting

More information

SQL language. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c)

SQL language. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c) SQL language Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c) 2011-2016 SQL - Structured Query Language SQL is a computer language for communicating with DBSM Nonprocedural (declarative) language What

More information

Data Modelling: 1 Entity, Keys & Attributes

Data Modelling: 1 Entity, Keys & Attributes Data Modelling: 1 Entity, Keys & Attributes Introduction Data (information) has become as precious a commodity to the organisation as the product they sell. The data and information accumulated by a company

More information

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210 SQL: Concepts Todd Bacastow IST 210: Organization of Data 2/17/2004 1 Design questions How many entities are there? What are the major entities? What are the attributes of each entity? Is there a unique

More information

Chapter 11 Database Concepts

Chapter 11 Database Concepts Chapter 11 Database Concepts INTRODUCTION Database is collection of interrelated data and database system is basically a computer based record keeping system. It contains the information about one particular

More information

Simple SQL. Peter Y. Wu. Dept of Computer and Information Systems Robert Morris University

Simple SQL. Peter Y. Wu. Dept of Computer and Information Systems Robert Morris University Simple SQL Peter Y. Dept of Computer and Information Systems Robert Morris University Simple SQL create table drop table insert into table values ( ) delete from table where update table set a to v where

More information

Exam code: Exam name: Database Fundamentals. Version 16.0

Exam code: Exam name: Database Fundamentals. Version 16.0 98-364 Number: 98-364 Passing Score: 800 Time Limit: 120 min File Version: 16.0 Exam code: 98-364 Exam name: Database Fundamentals Version 16.0 98-364 QUESTION 1 You have a table that contains the following

More information

Official Statistics - Relational Database Management Systems. Official Statistics - Relational Database Management Systems

Official Statistics - Relational Database Management Systems. Official Statistics - Relational Database Management Systems Chapter 1 Database fundamentals 1.1. What is a database? A database is a stored collection of data designed for efficient information retrieval, efficient data maintenance and centralised control of an

More information

Normalization Rule. First Normal Form (1NF) Normalization rule are divided into following normal form. 1. First Normal Form. 2. Second Normal Form

Normalization Rule. First Normal Form (1NF) Normalization rule are divided into following normal form. 1. First Normal Form. 2. Second Normal Form Normalization Rule Normalization rule are divided into following normal form. 1. First Normal Form 2. Second Normal Form 3. Third Normal Form 4. BCNF First Normal Form (1NF) As per First Normal Form, no

More information

A practical introduction to database design

A practical introduction to database design A practical introduction to database design Dr. Chris Tomlinson Bioinformatics Data Science Group, Room 126, Sir Alexander Fleming Building chris.tomlinson@imperial.ac.uk Computer Skills Classes 17/01/19

More information

MySQL. A practical introduction to database design

MySQL. A practical introduction to database design MySQL A practical introduction to database design Dr. Chris Tomlinson Bioinformatics Data Science Group, Room 126, Sir Alexander Fleming Building chris.tomlinson@imperial.ac.uk Database Classes 24/09/18

More information

EGCI 321: Database Systems. Dr. Tanasanee Phienthrakul

EGCI 321: Database Systems. Dr. Tanasanee Phienthrakul 1 EGCI 321: Database Systems Dr. Tanasanee Phienthrakul 2 Chapter 10 Data Definition Language (DDL) 3 Basic SQL SQL language Considered one of the major reasons for the commercial success of relational

More information

DATA Data and information are used in our daily life. Each type of data has its own importance that contribute toward useful information.

DATA Data and information are used in our daily life. Each type of data has its own importance that contribute toward useful information. INFORMATION SYSTEM LESSON 41 DATA, INFORMATION AND INFORMATION SYSTEM SMK Sultan Yahya Petra 1 DATA Data and information are used in our daily life. Each type of data has its own importance that contribute

More information

Logical Database Design. ICT285 Databases: Topic 06

Logical Database Design. ICT285 Databases: Topic 06 Logical Database Design ICT285 Databases: Topic 06 1. What is Logical Database Design? Why bother? Bad logical database design results in bad physical database design, and generally results in poor database

More information

WHAT IS SQL. Database query language, which can also: Define structure of data Modify data Specify security constraints

WHAT IS SQL. Database query language, which can also: Define structure of data Modify data Specify security constraints SQL KEREM GURBEY WHAT IS SQL Database query language, which can also: Define structure of data Modify data Specify security constraints DATA DEFINITION Data-definition language (DDL) provides commands

More information

«Information and communication technologies» Practical work 5. Databases

«Information and communication technologies» Practical work 5. Databases Practical work 5. Databases Objective: Understand that one of the advantages of a computer-based database is the ability to search for data quickly. Know what data types are. Be able to choose the correct

More information

Relational Database Theory. Relational Database Theory Database design using MySQL 21-Jan-06 : [1]

Relational Database Theory. Relational Database Theory Database design using MySQL 21-Jan-06 : [1] Relational Database Theory Relational Database Theory Database design using MySQL 21-Jan-06 : [1] Reminder MySQL is a Relational DBMS, so this section looks at Relational DB theory. The main reasons for

More information

WHAT IS A DATABASE? There are at least six commonly known database types: flat, hierarchical, network, relational, dimensional, and object.

WHAT IS A DATABASE? There are at least six commonly known database types: flat, hierarchical, network, relational, dimensional, and object. 1 WHAT IS A DATABASE? A database is any organized collection of data that fulfills some purpose. As weather researchers, you will often have to access and evaluate large amounts of weather data, and this

More information

Level 6 Relational Database Unit 3 Relational Database Development Environment National Council for Vocational Awards C30147 RELATIONAL DATABASE

Level 6 Relational Database Unit 3 Relational Database Development Environment National Council for Vocational Awards C30147 RELATIONAL DATABASE C30147 RELATIONAL DATABASE Level 6 Relational Database Unit 3 Relational Database Development Environment National Council for Vocational Awards This module has been developed to further the learner s

More information

Basic SQL. Basic SQL. Basic SQL

Basic SQL. Basic SQL. Basic SQL Basic SQL Dr Fawaz Alarfaj Al Imam Mohammed Ibn Saud Islamic University ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation Basic SQL Structured

More information

Information Systems Engineering. SQL Structured Query Language DDL Data Definition (sub)language

Information Systems Engineering. SQL Structured Query Language DDL Data Definition (sub)language Information Systems Engineering SQL Structured Query Language DDL Data Definition (sub)language 1 SQL Standard Language for the Definition, Querying and Manipulation of Relational Databases on DBMSs Its

More information

Basic SQL. Dr Fawaz Alarfaj. ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation

Basic SQL. Dr Fawaz Alarfaj. ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation Basic SQL Dr Fawaz Alarfaj Al Imam Mohammed Ibn Saud Islamic University ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation MIDTERM EXAM 2 Basic

More information

Database Systems CSE Comprehensive Exam Spring 2005

Database Systems CSE Comprehensive Exam Spring 2005 Database Systems CSE 5260 Spring 2005 Database Schema #1 Branch (Branch_Name, Branch_City, Assets) Customer (Customer_Name, SS#, Street, City, State, Zip_Code) Account (Account_Number, Branch_Name, Balance)

More information

Databases II: Microsoft Access

Databases II: Microsoft Access Recapitulation Databases II: Microsoft Access CS111, 2016 A database is a collection of data that is systematically organized, so as to allow efficient addition, modification, removal and retrieval. A

More information

NCSS: Databases and SQL

NCSS: Databases and SQL NCSS: Databases and SQL Tim Dawborn Lecture 1, January, 2016 Motivation SQLite SELECT WHERE JOIN Tips 2 Outline 1 Motivation 2 SQLite 3 Searching for Data 4 Filtering Results 5 Joining multiple tables

More information

Access Intermediate

Access Intermediate Access 2010 - Intermediate 103-134 Advanced Queries Quick Links Overview Pages AC116 AC117 Selecting Fields Pages AC118 AC119 AC122 Sorting Results Pages AC125 AC126 Specifying Criteria Pages AC132 AC134

More information

Data about data is database Select correct option: True False Partially True None of the Above

Data about data is database Select correct option: True False Partially True None of the Above Within a table, each primary key value. is a minimal super key is always the first field in each table must be numeric must be unique Foreign Key is A field in a table that matches a key field in another

More information

The University of Nottingham

The University of Nottingham The University of Nottingham SCHOOL OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY A LEVEL 1 MODULE, SPRING SEMESTER 2006-2007 DATABASE SYSTEMS Time allowed TWO hours Candidates must NOT start writing

More information

SQL Functionality SQL. Creating Relation Schemas. Creating Relation Schemas

SQL Functionality SQL. Creating Relation Schemas. Creating Relation Schemas SQL SQL Functionality stands for Structured Query Language sometimes pronounced sequel a very-high-level (declarative) language user specifies what is wanted, not how to find it number of standards original

More information

HKTA TANG HIN MEMORIAL SECONDARY SCHOOL SECONDARY 3 COMPUTER LITERACY. Name: ( ) Class: Date: Databases and Microsoft Access

HKTA TANG HIN MEMORIAL SECONDARY SCHOOL SECONDARY 3 COMPUTER LITERACY. Name: ( ) Class: Date: Databases and Microsoft Access Databases and Microsoft Access Introduction to Databases A well-designed database enables huge data storage and efficient data retrieval. Term Database Table Record Field Primary key Index Meaning A organized

More information

The WellComm Report Wizard Guidance and Information

The WellComm Report Wizard Guidance and Information The WellComm Report Wizard Guidance and Information About Testwise Testwise is the powerful online testing platform developed by GL Assessment to host its digital tests. Many of GL Assessment s tests are

More information

Q &A on Entity Relationship Diagrams. What is the Point? 1 Q&A

Q &A on Entity Relationship Diagrams. What is the Point? 1 Q&A 1 Q&A Q &A on Entity Relationship Diagrams The objective of this lecture is to show you how to construct an Entity Relationship (ER) Diagram. We demonstrate these concepts through an example. To break

More information

CS143: Relational Model

CS143: Relational Model CS143: Relational Model Book Chapters (4th) Chapters 1.3-5, 3.1, 4.11 (5th) Chapters 1.3-7, 2.1, 3.1-2, 4.1 (6th) Chapters 1.3-6, 2.105, 3.1-2, 4.5 Things to Learn Data model Relational model Database

More information

Solved MCQ on fundamental of DBMS. Set-1

Solved MCQ on fundamental of DBMS. Set-1 Solved MCQ on fundamental of DBMS Set-1 1) Which of the following is not a characteristic of a relational database model? A. Table B. Tree like structure C. Complex logical relationship D. Records 2) Field

More information

Ten Great Reasons to Learn SAS Software's SQL Procedure

Ten Great Reasons to Learn SAS Software's SQL Procedure Ten Great Reasons to Learn SAS Software's SQL Procedure Kirk Paul Lafler, Software Intelligence Corporation ABSTRACT The SQL Procedure has so many great features for both end-users and programmers. It's

More information

COGS 121 HCI Programming Studio. Week 03 - Tech Lecture

COGS 121 HCI Programming Studio. Week 03 - Tech Lecture COGS 121 HCI Programming Studio Week 03 - Tech Lecture Housekeeping Assignment #1 extended to Monday night 11:59pm Assignment #2 to be released on Tuesday during lecture Database Management Systems and

More information

CHAPTER 6 SUMMARY. Objective 1: Identify Good Database Design

CHAPTER 6 SUMMARY. Objective 1: Identify Good Database Design Objective 1: Identify Good Database Design CHAPTER 6 SUMMARY A database is an organized collection of data facts about people, events, things, or ideas related to a specific topic or purpose. Information

More information

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1 Basic Concepts :- 1. What is Data? Data is a collection of facts from which conclusion may be drawn. In computer science, data is anything in a form suitable for use with a computer. Data is often distinguished

More information

Introduction to SQL Server 2005/2008 and Transact SQL

Introduction to SQL Server 2005/2008 and Transact SQL Introduction to SQL Server 2005/2008 and Transact SQL Week 4: Normalization, Creating Tables, and Constraints Some basics of creating tables and databases Steve Stedman - Instructor Steve@SteveStedman.com

More information

IS 263 Database Concepts

IS 263 Database Concepts IS 263 Database Concepts Lecture 1: Database Design Instructor: Henry Kalisti 1 Department of Computer Science and Engineering The Entity-Relationship Model? 2 Introduction to Data Modeling Semantic data

More information

Creating SQL Tables and using Data Types

Creating SQL Tables and using Data Types Creating SQL Tables and using Data Types Aims: To learn how to create tables in Oracle SQL, and how to use Oracle SQL data types in the creation of these tables. Outline of Session: Given a simple database

More information

Chapter 1 SQL and Data

Chapter 1 SQL and Data Chapter 1 SQL and Data What is SQL? Structured Query Language An industry-standard language used to access & manipulate data stored in a relational database E. F. Codd, 1970 s IBM 2 What is Oracle? A relational

More information

EE221 Databases Practicals Manual

EE221 Databases Practicals Manual EE221 Databases Practicals Manual Lab 1 An Introduction to SQL Lab 2 Database Creation and Querying using SQL Assignment Data Analysis, Database Design, Implementation and Relation Normalisation School

More information

Module 3 MySQL Database. Database Management System

Module 3 MySQL Database. Database Management System Module 3 MySQL Database Module 3 Contains 2 components Individual Assignment Group Assignment BOTH are due on Mon, Feb 19th Read the WIKI before attempting the lab Extensible Networking Platform 1 1 -

More information

DBMS. Relational Model. Module Title?

DBMS. Relational Model. Module Title? Relational Model Why Study the Relational Model? Most widely used model currently. DB2,, MySQL, Oracle, PostgreSQL, SQLServer, Note: some Legacy systems use older models e.g., IBM s IMS Object-oriented

More information

Full file at

Full file at ch2 True/False Indicate whether the statement is true or false. 1. The SQL command to create a database table is an example of DML. 2. A user schema contains all database objects created by a user. 3.

More information

SQL Server and SQL Structured Query Language

SQL Server and SQL Structured Query Language SQL Server and SQL Structured Query Language Step by step Exercises Hans-Petter Halvorsen Database Systems Hans-Petter Halvorsen, M.Sc. Database Systems A Database is a structured way to store lots of

More information

Getting Information from a Table

Getting Information from a Table ch02.fm Page 45 Wednesday, April 14, 1999 2:44 PM Chapter 2 Getting Information from a Table This chapter explains the basic technique of getting the information you want from a table when you do not want

More information

Draft. Students Table. FName LName StudentID College Year. Justin Ennen Science Senior. Dan Bass Management Junior

Draft. Students Table. FName LName StudentID College Year. Justin Ennen Science Senior. Dan Bass Management Junior Chapter 6 Introduction to SQL 6.1 What is a SQL? When would I use it? SQL stands for Structured Query Language. It is a language used mainly for talking to database servers. It s main feature divisions

More information

Informatics 1: Data & Analysis

Informatics 1: Data & Analysis Informatics 1: Data & Analysis Lecture 3: The Relational Model Ian Stark School of Informatics The University of Edinburgh Tuesday 24 January 2017 Semester 2 Week 2 https://blog.inf.ed.ac.uk/da17 Lecture

More information

chapter 2 G ETTING I NFORMATION FROM A TABLE

chapter 2 G ETTING I NFORMATION FROM A TABLE chapter 2 Chapter G ETTING I NFORMATION FROM A TABLE This chapter explains the basic technique for getting the information you want from a table when you do not want to make any changes to the data and

More information

Introduction to Database. Dr Simon Jones Thanks to Mariam Mohaideen

Introduction to Database. Dr Simon Jones Thanks to Mariam Mohaideen Introduction to Database Dr Simon Jones simon.jones@nyumc.org Thanks to Mariam Mohaideen Today database theory Key learning outcome - is to understand data normalization Thursday, 19 November Introduction

More information

ICT IGCSE Databases (Access) A database is a collection of data or information stored in a logical format.

ICT IGCSE Databases (Access) A database is a collection of data or information stored in a logical format. A database is a collection of data or information stored in a logical format. Paper Based Database: Before computer based databases became available data would be kept on paper and stored in filing cabinets.

More information

Subodh Public School

Subodh Public School Subodh Public School08-9 Final Exam Class:Scholars (XI) Subject :- Informatics Practices Answer Key Q. Section-A 0 Marks A a)machine failure (b) Program failure (c) Operating failure (d) Control procedures

More information

Database Concepts Using Microsoft Access

Database Concepts Using Microsoft Access lab Database Concepts Using Microsoft Access 9 Objectives: Upon successful completion of Lab 9, you will be able to Understand fundamental concepts including database, table, record, field, field name,

More information

SQL Interview Questions

SQL Interview Questions SQL Interview Questions SQL stands for Structured Query Language. It is used as a programming language for querying Relational Database Management Systems. In this tutorial, we shall go through the basic

More information

SQL: Part II. Announcements (September 18) Incomplete information. CPS 116 Introduction to Database Systems. Homework #1 due today (11:59pm)

SQL: Part II. Announcements (September 18) Incomplete information. CPS 116 Introduction to Database Systems. Homework #1 due today (11:59pm) SQL: Part II CPS 116 Introduction to Database Systems Announcements (September 18) 2 Homework #1 due today (11:59pm) Submit in class, slide underneath my office door Sample solution available Thursday

More information

SQL Structured Query Language Introduction

SQL Structured Query Language Introduction SQL Structured Query Language Introduction Rifat Shahriyar Dept of CSE, BUET Tables In relational database systems data are represented using tables (relations). A query issued against the database also

More information

MAXQDA and Chapter 9 Coding Schemes

MAXQDA and Chapter 9 Coding Schemes MAXQDA and Chapter 9 Coding Schemes Chapter 9 discusses how the structures of coding schemes, alternate groupings are key to moving forward with analysis. The nature and structures of the coding scheme

More information

The Relational Model of Data (ii)

The Relational Model of Data (ii) ICS 321 Fall 2013 The Relational Model of Data (ii) Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 1 Defining Relational Schema in SQL Two aspects: Data

More information

DATA TYPES. Numeric Data

DATA TYPES. Numeric Data Numeric Data Numeric data simply means numbers. But, numbers come in a variety of different types... Integers An integer is a whole number - it has no decimal or fractional parts. Integers can be either

More information

3ISY402 DATABASE SYSTEMS

3ISY402 DATABASE SYSTEMS 3ISY402 DATABASE SYSTEMS - SQL: Data Definition 1 Leena Gulabivala Material from essential text: T CONNOLLY & C BEGG. Database Systems A Practical Approach to Design, Implementation and Management, 4th

More information

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Basic SQL Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Outline SQL Data Definition and Data Types Specifying Constraints in SQL Basic Retrieval Queries

More information

Introduction to SQL. IT 5101 Introduction to Database Systems. J.G. Zheng Fall 2011

Introduction to SQL. IT 5101 Introduction to Database Systems. J.G. Zheng Fall 2011 Introduction to SQL IT 5101 Introduction to Database Systems J.G. Zheng Fall 2011 Overview Using Structured Query Language (SQL) to get the data you want from relational databases Learning basic syntax

More information

CMPT 354: Database System I. Lecture 3. SQL Basics

CMPT 354: Database System I. Lecture 3. SQL Basics CMPT 354: Database System I Lecture 3. SQL Basics 1 Announcements! About Piazza 97 enrolled (as of today) Posts are anonymous to classmates You should have started doing A1 Please come to office hours

More information

Department of Computer Science and Information Systems, College of Business and Technology, Morehead State University

Department of Computer Science and Information Systems, College of Business and Technology, Morehead State University 1 Department of Computer Science and Information Systems, College of Business and Technology, Morehead State University Lecture 3 Part A CIS 311 Introduction to Management Information Systems (Spring 2017)

More information

SQL - Subqueries and. Schema. Chapter 3.4 V4.0. Napier University

SQL - Subqueries and. Schema. Chapter 3.4 V4.0. Napier University SQL - Subqueries and Chapter 3.4 V4.0 Copyright @ Napier University Schema Subqueries Subquery one SELECT statement inside another Used in the WHERE clause Subqueries can return many rows. Subqueries can

More information

Access Intermediate

Access Intermediate Access 2013 - Intermediate 103-134 Advanced Queries Quick Links Overview Pages AC124 AC125 Selecting Fields Pages AC125 AC128 AC129 AC131 AC238 Sorting Results Pages AC131 AC136 Specifying Criteria Pages

More information

INFORMATION TECHNOLOGY NOTES

INFORMATION TECHNOLOGY NOTES Unit-6 SESSION 7: RESPOND TO A MEETING REQUEST Calendar software allows the user to respond to other users meeting requests. Open the email application to view the request. to respond, select Accept, Tentative,

More information

[Author:Reverse]. <i>[title]</i>. [PubPlace]: [Publisher], [PubDate:Year].

[Author:Reverse]. <i>[title]</i>. [PubPlace]: [Publisher], [PubDate:Year]. Sentence Template Language Page 1 of 9 This document contains the vocabulary of fields in Roots Magic and will be demonstrated during the presentation. This handout can also be found under templates under

More information

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement Chapter 4 Basic SQL Basic SQL SQL language Considered one of the major reasons for the commercial success of relational databases SQL Structured Query Language Statements for data definitions, queries,

More information

Databases. Jörg Endrullis. VU University Amsterdam

Databases. Jörg Endrullis. VU University Amsterdam Databases Jörg Endrullis VU University Amsterdam The Relational Model Overview 1. Relational Model Concepts: Schema, State 2. Null Values 3. Constraints: General Remarks 4. Key Constraints 5. Foreign Key

More information

Level 3 Designing and creating relational databases (7266/ ) e-quals

Level 3 Designing and creating relational databases (7266/ ) e-quals Level 3 Designing and creating relational databases (7266/7267-047) e-quals Assignment guide for Candidates Assignment A www.cityandguilds.com/e-quals07 May 2011 Version 3.0 About City & Guilds City &

More information

CBSE Revision Notes Class-11 Computer Science (New Syllabus) Unit 3: Data Management (DM-1) Database

CBSE Revision Notes Class-11 Computer Science (New Syllabus) Unit 3: Data Management (DM-1) Database CBSE Revision Notes Class-11 Computer Science (New Syllabus) Unit 3: Data Management (DM-1) Database Database: A Database is an organized collection of facts. In other words we can say that it is a collection

More information

Level 2 Database software ( )

Level 2 Database software ( ) Level 2 Database software (7540-084) ITQ Assignment guide for Candidates Assignment B www.cityandguilds.com October 2017 Version 6.1 About City & Guilds City & Guilds is the UK s leading provider of vocational

More information

Downloaded from

Downloaded from Lesson 16: Table and Integrity Constraints Integrity Constraints are the rules that a database must follow at all times. Various Integrity constraints are as follows:- 1. Not Null: It ensures that we cannot

More information

SQL DATA DEFINITION LANGUAGE

SQL DATA DEFINITION LANGUAGE 9/27/16 DATABASE SCHEMAS IN SQL SQL DATA DEFINITION LANGUAGE SQL is primarily a query language, for getting information from a database. SFWR ENG 3DB3 FALL 2016 But SQL also includes a data-definition

More information

First Normal Form. Second Normal Form. Third Normal Form. Fourth Normal Form. Fifth Normal Form. Assoc.Prof.Dr.B.

First Normal Form. Second Normal Form. Third Normal Form. Fourth Normal Form. Fifth Normal Form. Assoc.Prof.Dr.B. First Normal Form Second Normal Form Third Normal Form Fourth Normal Form Fifth Normal Form Normalizing Data Model Topic Objectives This topic discusses Normalization. At the end of the topic, you will

More information

Full file at

Full file at SQL for SQL Server 1 True/False Questions Chapter 2 Creating Tables and Indexes 1. In order to create a table, three pieces of information must be determined: (1) the table name, (2) the column names,

More information

Database Management System Dr. S. Srinath Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

Database Management System Dr. S. Srinath Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. Database Management System Dr. S. Srinath Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. # 5 Structured Query Language Hello and greetings. In the ongoing

More information

Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level

Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level *2898775305* COMPUTER SCIENCE 9608/11 Paper 1 Theory Fundamentals October/November 2017 1 hour 30 minutes

More information

Data, Databases, and DBMSs

Data, Databases, and DBMSs Todd S. Bacastow January 2004 IST 210 Data, Databases, and DBMSs 1 Evolution Ways of storing data Files ancient times (1960) Databases Hierarchical (1970) Network (1970) Relational (1980) Object (1990)

More information

LORD P.C.A.A Lions Mat.Hr.Sec School, Lions Nagar, Reserve Line, Sivakasi. 7.Data Base. PART A I. Choose the correct Answer : 15 X 1 = 15

LORD P.C.A.A Lions Mat.Hr.Sec School, Lions Nagar, Reserve Line, Sivakasi. 7.Data Base. PART A I. Choose the correct Answer : 15 X 1 = 15 7.Data Base PART A I. Choose the correct Answer : 15 X 1 = 15 1. Which of the following is not a valid data type in star office base? a) Text b) time c) project d) integer 2. Which field is used to uniquely

More information

Meaning & Concepts of Databases

Meaning & Concepts of Databases 27 th August 2015 Unit 1 Objective Meaning & Concepts of Databases Learning outcome Students will appreciate conceptual development of Databases Section 1: What is a Database & Applications Section 2:

More information

Database Management System

Database Management System Database Management System Database: A database is a collection of data. By data, we mean known facts that can be recorded. A data Base Management System (DBMS) is a collection of Computer Programs that

More information

Announcements (September 18) SQL: Part II. Solution 1. Incomplete information. Solution 3? Solution 2. Homework #1 due today (11:59pm)

Announcements (September 18) SQL: Part II. Solution 1. Incomplete information. Solution 3? Solution 2. Homework #1 due today (11:59pm) Announcements (September 18) 2 SQL: Part II Homework #1 due today (11:59pm) Submit in class, slide underneath my office door Sample solution available Thursday Homework #2 assigned today CPS 116 Introduction

More information

3 February 2011 CSE-3421M Test #1 p. 1 of 14. CSE-3421M Test #1. Design

3 February 2011 CSE-3421M Test #1 p. 1 of 14. CSE-3421M Test #1. Design 3 February 2011 CSE-3421M Test #1 p. 1 of 14 CSE-3421M Test #1 Design Sur / Last Name: Given / First Name: Student ID: Instructor: Parke Godfrey Exam Duration: 75 minutes Term: Winter 2011 Answer the following

More information

Create a simple database with MySQL

Create a simple database with MySQL Create a simple database with MySQL 1.Connect the MySQL server through MySQL Workbench You can achieve many database operations by typing the SQL langue into the Query panel, such as creating a database,

More information

Database Normalization is the process of efficiently organizing data in a database. There are two goals of the normalization process:

Database Normalization is the process of efficiently organizing data in a database. There are two goals of the normalization process: NORMAL FORMS INTRODUCTION Normal Forms can be simply defined as database normalization rules/conditions. It is a condition of using keys and functional dependencies (FDs) of a relation to certify whether

More information

Chapter 9: MySQL for Server-Side Data Storage

Chapter 9: MySQL for Server-Side Data Storage Chapter 9: MySQL for Server-Side Data Storage General Notes on the Slides for This Chapter In many slides you will see webbook as a database name. That was the orginal name of our database. For this second

More information

Chapter 2 Working with Data Types and Operators

Chapter 2 Working with Data Types and Operators JavaScript, Fourth Edition 2-1 Chapter 2 Working with Data Types and Operators At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics

More information

Relational Model, Key Constraints

Relational Model, Key Constraints Relational Model, Key Constraints PDBM 6.1 Dr. Chris Mayfield Department of Computer Science James Madison University Jan 23, 2019 What is a data model? Notation for describing data or information Structure

More information

EXAM Microsoft Database Fundamentals. Buy Full Product.

EXAM Microsoft Database Fundamentals. Buy Full Product. Microsoft EXAM - 98-364 Microsoft Database Fundamentals Buy Full Product http://www.examskey.com/98-364.html Examskey Microsoft 98-364 exam demo product is here for you to test the quality of the product.

More information

What is a database? Lesson - 1

What is a database?  Lesson - 1 Lesson - 1 www.semainformatics.wordpress.com What is a database? A database is any collection of data that is organized for quick retrieval. Databases can be computer based or paper based 1 Examples of

More information

Data analysis and design Unit number: 23 Level: 5 Credit value: 15 Guided learning hours: 60 Unit reference number: H/601/1991.

Data analysis and design Unit number: 23 Level: 5 Credit value: 15 Guided learning hours: 60 Unit reference number: H/601/1991. Unit title: Data analysis and design Unit number: 23 Level: 5 Credit value: 15 Guided learning hours: 60 Unit reference number: H/601/1991 UNIT AIM AND PURPOSE The aim of this unit is to equip learners

More information

Multiple-Choice. 3. When you want to see all of the awards, even those not yet granted to a student, replace JOIN in the following

Multiple-Choice. 3. When you want to see all of the awards, even those not yet granted to a student, replace JOIN in the following Database Design, CSCI 340, Spring 2015 Final, May 12 Multiple-Choice 1. Which of the following is not part of the vocabulary of database keys? (3 pts.) a. Referential key b. Composite key c. Primary key

More information

Ministry of Higher Education and Scientific research

Ministry of Higher Education and Scientific research Department of IT Technical Institute of Amedi Duhok Polytechnic University Subject: Database System Course Book: Year 2 (Second year) Lecturer's name: Dipl.Eng.Shorash A. Sami Academic Year: 2018/2019

More information

IGCSE Information Communication Technology (ICT) Syllabus code Section 5: Data types

IGCSE Information Communication Technology (ICT) Syllabus code Section 5: Data types IGCSE Information Communication Technology (ICT) Syllabus code 0417 Section 5: Data types At the end of this Unit students will be able to: (a) identify different data types: logical/boolean, alphanumeric/text,

More information

Fundamentals of Database Systems (INSY2061)

Fundamentals of Database Systems (INSY2061) Fundamentals of Database Systems (INSY2061) 1 What the course is about? These days, organizations are considering data as one important resource like finance, human resource and time. The management of

More information