Skip to main content

Database


What is Database ?


  • A database is a collection of information that is organized so that it can be easily accessed, managed and updated.
  • Data is organized into rows, columns and tables, and it is indexed to make it easier to find relevant information.

What is Database Management System?


  • A database management system (DBMS) is system software for creating and managing databases.
  • The DBMS provides users and programmers with a systematic way to create, retrieve, update and manage data.

 Tables (Database)


  • A database table is composed of records and fields that hold data.
  • Tables are also called datasheets. Each table in a database holds data about a different, but related, subject.
Figure 1

Record (Database)

  • Data is stored in records.
  •  A record is composed of fields and contains all the data about one particular person, company, or item in a database. 
  • In this database, a record contains the data for one customer support incident report. Records appear as rows in the database table. 

Field (Database)



A field is part of a record and contains a single piece of data for the subject of the record. In the database table illustrated in Figure 4, each record contains four fields:




Log IDA number assigned to this customer support incident for identification purposes
OperatorThe code for the customer support operator who handled this incident
ResolvedA check box to indicate whether the incident was resolved
DurationThe time in seconds the operator spent on this incident

Report (Database)

  • A database report is the formatted result of database queries and contains useful data for decision-making and analysis.
  • Data can be grouped or sorted and arranged in a variety of ways.


Query (Database)

  • A query finds records in a database according to criteria you specify.
  • Sometimes working with all the data in a large database is not practical. 
  • You might wish to work with just a small part or subset of the data. 
  • For example, you might want to find records for unresolved customer support incidents.
  • A query can be used to display these records.
  • You could construct the query to display only selected fields, such as Log ID and Resolved.

Primary Key



A primary key is a special relational database table column (or combination of columns) designated to uniquely identify all table records.

A primary key’s main features are:
  • It must contain a unique value for each row of data.
  • It cannot contain null values.
A primary key is either an existing table column or a column that is specifically generated by the database according to a defined sequence.

Tips for Choosing Good Primary Keys

When you choose the right primary key, database lookups are speedy and reliable. Just remember:
  • Keep it short. Because the primary key is used for lookups and comparisons, a short primary key means the database management system can process it more quickly than a long primary key.
  • Use a number for the primary key whenever possible. SQL Server or other database management systems process number data types faster than character data types.
  • Keep it simple. Don't use any special characters, embedded spaces, or a mix of upper and lower capitalization.
  • Never change the primary key after you assign it.


Foreign Key 

  • A foreign key is a column or columns of data in one table that connects to the primary key data in the original table.
  • To ensure the links between foreign key and primary key tables aren't broken, foreign key constraints can be created to prevent actions that would damage the links between tables 
  • It also prevent erroneous data from being added to the foreign key column.

Differences between primary and foreign keys

  • A primary key in the original table, or parent table, can be targeted by multiple foreign keys from other "child" tables
  • But a primary key does not necessarily have to be the target of any foreign keys. A primary key is a column or a set of columns that identify a row in a table.
  • A foreign key, however, is in a table that is different from the table that the primary key must match.

References


Comments

Post a Comment

Popular posts from this blog

Programming ?!!!

PROGRAMMING Hi Everyone ! What is Programming ? Programming  is the process of taking an algorithm and encoding it into a notation, a programming language, so that it can be executed by a computer. Define Programming Language  A  prog ra mming language  is a special language programmers  use to develop software programs, scripts , or other sets of instructions for computers to execute.  Types of Programming Language Different languages have different purposes, so it makes sense to talk about different kinds, or types, of languages. Some types are: Machine languages , that are interpreted directly in hardware Assembly languages , that are thin wrappers over a corresponding machine language High-level languages , that are anything machine-independent System languages , that are designed for writing low-level tasks, like memory and process management Scripting languages , that are generally extremely high-level and powerful Domain-s...

How to disassemble a system unit πŸ™ƒ

HELLO EVERYONE πŸ‘‹πŸ» IM BACKKK !  So today im gonna share my experience about assembling and disassembling a system unit that me and friends did last friday ☺️   HOW TO DISASSEMBLE A SYSTEM UNIT πŸ’»   Step 1; Outer Casing  🌸 First off, unscrew the four screws on the back of the computer. On most computer cases, there will be large knobs that you can unscrew by hand or by screw driver on the back-right side of the computer. Once the screws removed then just slide it off . Step 2 ; System fan  🌸 most computers have 2 fans   a) system fan -the one blowing air to the computer b) CPU fan - the one blowing air onto the CPU heat sink . 🌸 unplug the fan from motherboard . Next , you need to unscrew the fan from the outside . You should now be able to lift the fan out the PC . Step 3 ; CPU fan  🌸 The CPU fan is located right on top of the CPU heat sink . It is hard to access becau...