Ways to create Database?

     

    We can create the database in two types:

     

  • Creation of Database using Navigation
  • Creation of Database using Query
  •  

     

    Creation of Database using Navigation

  • Open the Management Studio Tool
  • Right click on “Databases” and select “New Database”
  •  

     

  • Enter the name of Database and click on OK
  • New database has been created.
  •  

     

    Creation of Database using QUERY:

    Syntax - Create Database

    Create Database <Database name>

    Ex:Create database SQLQueries

     

    Connect To Database:

    Syntax - Connect to Database

    Use <Database Name>

     

    To connect the database use “USE” command.

    EX: use SQLQueries

     

    Rename The Database:

    Syntax - Rename the Database

    Sp_renamedb ‘old name’, ‘new name’

     

    Ex:sp_renamedb 'SQLQueries', 'NewSQLQueries'

     

    Syntax - Delete the Database

    Drop Database <Database Name>

    Ex:drop database SQLQueries

    Drop command is used to delete the database

     

     

    Click on the Image to watch video - of Database Creation

     

     

     

    What is meant by DATA?

     

    A collection of corresponding relevant facts withrepect to an object is termed as DATA

     

    Example: Consider HEAD as Objects, relevant data for head is as mentioned below:

     

     

    DATA for HEAD
    DATA
    Eyes
    Nose
    Ears
    Mouth

     

    What is meant by DATABASE?

     

    Database is a systematic Collection of Data

     

     

    Create Table

     

     

    Syntax - Create Table with the name of COMPANY

    Create table Company
    (Name varchar (15),
    Sales int,
    DateOfInc Date,
    Staff int,
    Emp_Name varchar(15))

     

    Create Table

     

     

     

    Syntax - Insert values into company

    insert into Company values('Almond',300,'1/1/2011',150,'Raju')
    insert into Company values('Milk',400,'1/1/2012',125,'Anil')
    insert into Company values('Apple',400,'1/1/2013',324,'Mahesh')
    insert into Company values('Banana',500,'1/1/2014',254,'Ram')
    insert into Company values('Orange',400,'1/1/2015',852,'Chiranjeevi')
    insert into Company values('Grapes',350,'1/1/2016',964,'Raghu')
    insert into Company values('Sriguranjani',324,'1/1/2012',214,'Pavan')
    insert into Company values('Tricks12345',324,'1/1/2013',625,'Pavan')
    insert into Company values('Mango',587,'1/1/2014',847,'Manoj')
    insert into Company values('Onion',241,'1/1/2015',326,'Harsha')

     

     

     

    Insert values into table

     

  • Click on image to view the video
  •  

    What is the objective of DATABASE?

     

    With the help of database we can

  • Insert Data
  • Update Data
  • Delete Data
  • Retrive Data
  •  

    Differentiate Database & Datawarehouse?

     

  • Database is collection of related data
  • Different databases are stored in a area called Datawarehouse
  •