Databases Intro SQL

By   Tewodros   Date Posted: Sep. 21, 2021  Hits: 755   Category:  Database   Total Comment: 0             A+ A-


side

Database

  1. storage place for related date
  2. contains tables that actually stores the data.
  3. tables contain fields or attributes or columns.

Tables

  1. stores information about specific real-world object
  2. examples: student, course, instructor, employee, department
  3. contains fields or attributes or columns.

Columns

  1. they are the final storage place for data.
  2. examples: first name, last name, salary
  3. tells you what kind of data you are storing.
  4. should specify the datatype of each column.

Rows

  1. actual entries/sample data
  2. example: Abebe, 2000

Datatype

  1. is the type of data that you are storing in to the column
  2. example: int, bigint, float, varchar(25), varchar (max), bit
  3. bit: Boolean( only true or false)
  4. int (numbers starting from 0, 1, ----)
  5. varchar: any text  for ex. John, Doe
  6. decimal: decimal number like 2.5, 2000.50
  7. char: to store only one character for ex. ‘M’ for Male
  8. datetime: to store date and time together. example: 2/28/2021 5:04 PM
  9. smalldatetime : is the same as datetime except with out the hour part. ex. 2/28/2021

Primary Key

It is unique identifier of the records of a given table

Ex: Id ,SSN ,Driver License 

  1. But first name, last name or address, DOB cannot a primary key
  2. All attributes of a record are dependent on the primary key

Foreign Key

A primary key from other table inserted in to another table to establish a relationship with the other table.


Tags



Back to Top



Related Blogs






Please fill all fields that are required and click Add Comment button.

Name:*
Email:*
Comment:*
(Only 2000 char allowed)


Security Code:* gpdjrt

Back to Top