Database
- storage place for related date
- contains tables that actually stores the data.
- tables contain fields or attributes or columns.
Tables
- stores information about specific real-world object
- examples: student, course, instructor, employee, department
- contains fields or attributes or columns.
Columns
- they are the final storage place for data.
- examples: first name, last name, salary
- tells you what kind of data you are storing.
- should specify the datatype of each column.
Rows
- actual entries/sample data
- example: Abebe, 2000
Datatype
- is the type of data that you are storing in to the column
- example: int, bigint, float, varchar(25), varchar (max), bit
- bit: Boolean( only true or false)
- int (numbers starting from 0, 1, ----)
- varchar: any text for ex. John, Doe
- decimal: decimal number like 2.5, 2000.50
- char: to store only one character for ex. ‘M’ for Male
- datetime: to store date and time together. example: 2/28/2021 5:04 PM
- 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
- But first name, last name or address, DOB cannot a primary key
- 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.