Basics of DataBase



Data:
Whatever we are inputting from the keyboard is known as Data. It can also be called as rawfacts / figures
Data never provides any meaning for us
Information:
Processed Data is known as Information
Information always gives meaning for us

Example:-
Data collected from census is used to generate different type of information. The government can use it to determine the literacy rate in the country. Government can use the information in important decision to improve literacy rate.
Database:
Collection of information belongs to a particular topic (an organization) written in a predetermined manner stored at a particular place so, as per easy retrieval
     DataBases are classified into two types:-
     1.System Defined Database
     2.User Defined Database
(1)System Defined Database:-

The DB which will be automatically available when we install SQL Server software.
Different types of system Databases are:-

1)    master
2)    model
3)    msdb
4)    tempdb

1.master:-this db will maintain user authentication details /system configurations to run SqlServer DB.
2.  model:-model is template for other databases.
3.   msdb:-msdb is used to schedule jobs and alerts.
4.Tempdb:-this DB is used to perform temporary calculations on the database.

(2)User Defined Database:-
     The DB which was created based on user requirement is called as user defined           database.
Database is collection of database objects like tables,views,procedures.
Table is called database object
In table data will be stored in the form of rows and columns.
Creating a new database:-
We can create database/Database objects in two ways:-
1.     By Writing Queries
2.     By using GUI(Graphical user interface)

Syntax for creating a database:- 
Sy:-create database database name
Ex:- create Database Sampath – creating a database

Use the created database:-
By default all tables will be created under master database
If you want to use the created database
Sy:-use DatabaseName
Ex:- use Sampath –to use the Sampath Database

Write a query to get the information of database.
Sy:- sp_helpdb DatabaseName
Ex:- Sp_HelpDb Sampath  --to know the details of the DataBase
The above command will get the information /description of the database like databasename,database creation time,database size Etc.

WAQ to Rename the existing database
Sy:-sp_Rename oldDatabaseName,new databasename
Ex:- sp_renamedb Sampath,Kumar –to Rename the database Name


DBMS (Data Base Management System):

It is a software which is present inside the database, which can maintain and manage the data within the database

Properties of RDBMS:
  1. In this model data should be stored in the form of tables
  2. A table can be defined as collection of rows & columns
  3. The horizontal lines are known as rows/ records / tuples
  4. The vertical lines are known as columns / fields / Attributes
  5. The intersection of rows & columns is known as cell
  6. A cell is a place where we can store our actual data
  7. The other name of table can be called as “Entity”
  8. Table should not contain any duplicate columns
  9. When we define the column in the table user no need to follow any specific order
  10. When we insert the records into the table user no need to follow any specific order
  11. Database should not contain duplicate values

No comments:

Post a Comment