Sunday, 8 November 2015

Fields and Records in Sql with Each Character.

fields and records in sql with each character | problem solving in my sql education

FIELD
Field is a column of a table. Field has the size of a particular data type that determines how the data will be saved.
The properties of the field is as follows: 
      1.        As the Primary key 
             attribute of Primary is the least that can distinguish each row of data in a table is uniquely     selected based on frequently used as a reference, more concise, and more guarantee a unique key.
Example: NIM students is the primary key of the table student. Nim has the function to be



linked with other tables that have relationships.

      2.       As the Foreign key
      Foreign Key is a column taken from the primary key of another entity that shows the relationship between the two tables.
      Example: if a user input the department code 10, whereas in the database does not exist such a   code, then the code will be rejected. Foreign key also serves to prevent the manipulation of data by parties who are not responsible.

       3.   As the Uniqe
     No same field.

       4.   AutoIncrement
      No field - specific fields that do not need to fill, but the system will fill in data to those fields.
      e.g. serial number, system will automatically fill in the serial number and any data will increase in value.

      5.     Has a default value
      if we do not put the data fields in the table, then we can provide default values for those fields.

     6.     Auto compute
      sometimes we need a calculation,
      for example, we enter the amount of purchases of goods 9, while the price of an item @3000       then the total field can be    filled automatically by calculating the total amount of purchases  by       multiplying the purchase price per unit.

     7.     Nullable
     The data in a field can be blank. The term in the database is NULL. NULL is not equal to zero.     Opponents of null is not null.


RECORD
Record is a collection of the contents of the data elements (attributes) that are interconnected to inform you about a complete entity.
Often called the line a table, containing data of each column of the table.

Statement in sql divided into 3 categories:
1. Data Definition Language (DDL)
Support the definition section of a table such as the creation, deletion and modification of tables.

2. Data Manipulation Language (DML)
    Allows users to process or manipulate the database, query example INSERT, UPDATE, and DELETE

3. Retrieving Data
    Display data, it is a SELECT query.
    For the next will be discussed in this article.


References :
Sistem Basis Data,Utami Ema | Anggit Dwi Hartanto, 2012, Yoyakarta, Andi.

No comments:

Post a Comment