Introduction To Database

Introduction

A basic lesson on what a database is, how they work and what they are used for. An introduction to basic database concepts and terms.

Watch the video below and read the background information.

[video:https://www.youtube.com/watch?v=gfT7EGibry0 width:640px height:360px]

The basic electronic information storage unit

A database is a collection of information organized to provide efficient retrieval. The collected information could be in any number of formats (electronic, printed, graphic, audio, statistical, combinations). There are physical (paper/print) and electronic databases.

A database could be as simple as an alphabetical arrangement of names in an address book or as complex as a database that provides information in a combination of formats.

Examples:

  • phone book
  • address book
  • Census Bureau data

Task

By the end of this lesson, you will be able to recognize and fully understand database and terms of database.

The following questions are asked before the start of the course. You should search and answer them.

  • How data is stored on the computer?
  • What is the database?
  • What areas are  functions of the database?

When you answer the questions, you will able to know database background information.

Process

Database Terms and their Meanings

Before learning the language you will have to learn some words and their meanings. Basic stuff, but you cannot continue without them. Feel free to skip any word if you already know the meaning.

Database

A database is a collection of data that is organized in a specific way. The data is stored in a way that makes it easy to access using queries. For example, a database called 'Simpsons'.

Table

A database can have multiple tables in it. All the data is stored in the tables. A table has a set of fields in it. These fields makes the design or the structure of the database.
The database 'Simpsons' has two tables - called 'Character' and 'Quote'

Field

Each table has a set of fields.

Our example table 'Character' has four fields - id, name, iq and sex.

Data Type

Each field can have only one kind of data. That is called the Data Type of that field. This can be a string, an integer, a date, etc.

When creating a table, you have to specify the kind of data that can be stored in that field. One field can be used to store a number, another for a string. Since every table has a number of fields, different types of data can be stored in a table.

The data type in our example table 'Character' are...

  • id - integer
  • name - string
  • iq - integer
  • sex - string(actually it is enum - 'm' or 'f' - more on this later)

Row

All the terms till now dealt with the structure - row refers to the data. It can also called a record. The collection of a set of values for all fields in one table is together called a row. Yeah, even I cannot understand that definition. But an example will make things clearer - the first row of the Character table has these values...

All this together is called a row.

Primary Key

Primary key is a field that will uniquely identify each row in the table. The value of this field will be unique through the table. In our example table, 'id' is the primary key. This will be 1 for the first row, 2 for the second and so on.

Relation

There will be many cases when the data in one table can be related to the data in another table. This connection between two tables is called a relation.

Foreign Key

When there is a relation between 2 tables, these tables will be connected by inserting the primary key of one table into the corresponding row of the other table. The field used in such a way to connect the 2 tables is called the foreign key.

For example, the 'Quote' table has 3 fields id, character_id, and quote. The character_id field will have the id of the character who spoke the quote - as shown here...

Character Table
Quote Table

The Christmas joke was made by the character with id 3 - that is Bart. And the 'wedding' quote has the character_id 1 that means it is spoken by Homer.

Sorry if you find the definitions here a bit too much. Trust me - you are much better off here than if you are learning SQL from a database book. They are going to lay definitions on you till your eyes bleed. I have seen brave men die from too much exposure to definitions.

Evaluation

We will assess you by observing your effort in this activity. We expect you to take each step seriously.You will take quiz that is include 10 multiple choice questions. Each question is 10 point. If you get greater than 70 we will asume you understand this course.

Your score > 70 = Well

Your Score < 70 = Fail

Conclusion

End of the couse, you should able to 

  • Know the database concepts.
  • Provide examples from Database software.
  • Understand the difference between data and information.
  • Creates the database objects

Congratulations!! you comple the course.

Credits

Teacher Page