Ways to create Database?
Create Database <Database name>
Ex:Create database SQLQueries
Use <Database Name>
To connect the database use “USE” command.
EX: use SQLQueries
Sp_renamedb ‘old name’, ‘new name’
Ex:sp_renamedb 'SQLQueries', 'NewSQLQueries'
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:
What is meant by DATABASE?
Database is a systematic Collection of Data
Create Table
Create table Company
(Name varchar (15),
Sales int,
DateOfInc Date,
Staff int,
Emp_Name varchar(15))
Create Table
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
What is the objective of DATABASE?
With the help of database we can
Differentiate Database & Datawarehouse?