SlideShare a Scribd company logo
3SQL SERVER: CREATINGA DATABASE
Creating a SQL Server DatabaseSTEPS IN CREATING A DATABASE IN 3 SIMPLE STEPS Understand the problem. Think of the essential data elements which are to  become a part of the database Create the database using the SQL server 2008 –   Command Prompt Feed data into the databaseLets  take a look at how this can be done
Step 1: Understand the problemAnalyze the problem and abstract the essential details that are to be storedFor example, if you wish to construct a database of the grocery items that are to be bought, the essential facts would be: Name of the item
 Type of the Item
 CostWe need not bother about the ‘less’ significant data like ISI certificate number or the Ingredients from a daily-user’s perspectiveBottom-line: Take the important stuff, ignore the rest.
Step 2: Create the databaseThe Next step is to create the database schema. The schema (pronounced as skee-ma) is the structure of the database, which is described in a DBMS language like SQL.For the Grocery-Database, the schema of a table of items may look like:The Item number is a key, i.e., it is used to uniquely locate a product in a database.
Step 2: Create the databaseSearching a DB Without a Primary Key: NOT EFFICIENTComputer: Now which out of these do you need?User: Search for ‘Milk’Database is searched and 2 entries match
Step 2: Create the databaseSearching a DB witha Primary Key: EFFICIENTComputer: I got it! User: Search for Item with ID 102Database is searched and 1 entry matchesDB With a Primary KeyHence, always include primary keys in your DB deign
Step 2: Create the databaseCreating the DB using SQL Server 2008 – Command Prompt
Step 2: Create the databaseThe SQL Language consists of 3 major subsets, based on the nature of the commands:
Step 2: Create the databaseThe SQL command for database creation falls under the DDL Language as it lets the user ‘define’ the database structure1.Open the SQL Server Command Prompt:	Open Command Prompt: Click on START-> RUN-> Type ‘cmd’Activate SQL Command PromptType ‘sqlcmd’ in the command prompt that was opened
Step 2: Create the database2.Type the Command	The Syntax of the table-creation command is:create table <table-name> ( <fieldNamefieldTpye>,…);The Common Attributes/Fields types are:Number
Eg: Product ID: 2324234
Float (decimals)
Ad

Recommended

Destiny Overview
Destiny Overview
haroldgrant70
 
JDeveloper - table relations
JDeveloper - table relations
jcmsdevelopment
 
JDeveloper - create component
JDeveloper - create component
jcmsdevelopment
 
T.2.8.pp
T.2.8.pp
coachhahn
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
baabtra.com - No. 1 supplier of quality freshers
 
SQL Server Stored procedures
SQL Server Stored procedures
Randy Riness @ South Puget Sound Community College
 
5. stored procedure and functions
5. stored procedure and functions
Amrit Kaur
 
MS SQLSERVER:Joining Databases
MS SQLSERVER:Joining Databases
sqlserver content
 
Introduction To SQL Server 2014
Introduction To SQL Server 2014
Vishal Pawar
 
Chapter 4 functions, views, indexing
Chapter 4 functions, views, indexing
baabtra.com - No. 1 supplier of quality freshers
 
Sql server performance tuning
Sql server performance tuning
ngupt28
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Stored-Procedures-Presentation
Stored-Procedures-Presentation
Chuck Walker
 
Sqlserver 2012 installation step by step
Sqlserver 2012 installation step by step
Oracle Apps DBA
 
SQL Server 2012 and Big Data
SQL Server 2012 and Big Data
Microsoft TechNet - Belgium and Luxembourg
 
Unit4_Lecture-sql.ppt and data science relate
Unit4_Lecture-sql.ppt and data science relate
umang2782love
 
Database Management System - SQL beginner Training
Database Management System - SQL beginner Training
Moutasm Tamimi
 
Lec-w9-SQL.pptx Introduction to SQL in basics
Lec-w9-SQL.pptx Introduction to SQL in basics
zylzuht983
 
Creating Database 2010
Creating Database 2010
tgushi12
 
sdfsdfsdsdfsdfsdfsdfsdfsfdsfsdfsdfql.pdf
sdfsdfsdsdfsdfsdfsdfsdfsfdsfsdfsdfql.pdf
1mikhail2015
 
01 data modeling-and-er-diagrams
01 data modeling-and-er-diagrams
glubox
 
Complete SQL in one video by shradha.pdf
Complete SQL in one video by shradha.pdf
rahulashu699
 
Organisation of database Organisation of database
Organisation of database Organisation of database
praygodmwanga32
 
mySQL and Relational Databases
mySQL and Relational Databases
webhostingguy
 
chapter 8 SQL.ppt
chapter 8 SQL.ppt
YitbarekMurche
 
MySql slides (ppt)
MySql slides (ppt)
webhostingguy
 
Database queries
Database queries
IIUM
 
Presentation DBMS (1)
Presentation DBMS (1)
Ali Raza
 
Sql server T-sql basics ppt-3
Sql server T-sql basics ppt-3
Vibrant Technologies & Computers
 
1585625790_SQL-SESSION1.pptx
1585625790_SQL-SESSION1.pptx
MullaMainuddin
 

More Related Content

Viewers also liked (7)

Introduction To SQL Server 2014
Introduction To SQL Server 2014
Vishal Pawar
 
Chapter 4 functions, views, indexing
Chapter 4 functions, views, indexing
baabtra.com - No. 1 supplier of quality freshers
 
Sql server performance tuning
Sql server performance tuning
ngupt28
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Stored-Procedures-Presentation
Stored-Procedures-Presentation
Chuck Walker
 
Sqlserver 2012 installation step by step
Sqlserver 2012 installation step by step
Oracle Apps DBA
 
SQL Server 2012 and Big Data
SQL Server 2012 and Big Data
Microsoft TechNet - Belgium and Luxembourg
 

Similar to MS SQLSERVER:Creating A Database (20)

Unit4_Lecture-sql.ppt and data science relate
Unit4_Lecture-sql.ppt and data science relate
umang2782love
 
Database Management System - SQL beginner Training
Database Management System - SQL beginner Training
Moutasm Tamimi
 
Lec-w9-SQL.pptx Introduction to SQL in basics
Lec-w9-SQL.pptx Introduction to SQL in basics
zylzuht983
 
Creating Database 2010
Creating Database 2010
tgushi12
 
sdfsdfsdsdfsdfsdfsdfsdfsfdsfsdfsdfql.pdf
sdfsdfsdsdfsdfsdfsdfsdfsfdsfsdfsdfql.pdf
1mikhail2015
 
01 data modeling-and-er-diagrams
01 data modeling-and-er-diagrams
glubox
 
Complete SQL in one video by shradha.pdf
Complete SQL in one video by shradha.pdf
rahulashu699
 
Organisation of database Organisation of database
Organisation of database Organisation of database
praygodmwanga32
 
mySQL and Relational Databases
mySQL and Relational Databases
webhostingguy
 
chapter 8 SQL.ppt
chapter 8 SQL.ppt
YitbarekMurche
 
MySql slides (ppt)
MySql slides (ppt)
webhostingguy
 
Database queries
Database queries
IIUM
 
Presentation DBMS (1)
Presentation DBMS (1)
Ali Raza
 
Sql server T-sql basics ppt-3
Sql server T-sql basics ppt-3
Vibrant Technologies & Computers
 
1585625790_SQL-SESSION1.pptx
1585625790_SQL-SESSION1.pptx
MullaMainuddin
 
unit 1 ppt.pptx
unit 1 ppt.pptx
VillainMass
 
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
APMRETAIL
 
Info systems databases
Info systems databases
MR Z
 
Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statements
Steve Xu
 
Presentation1
Presentation1
ahsan-1252
 
Unit4_Lecture-sql.ppt and data science relate
Unit4_Lecture-sql.ppt and data science relate
umang2782love
 
Database Management System - SQL beginner Training
Database Management System - SQL beginner Training
Moutasm Tamimi
 
Lec-w9-SQL.pptx Introduction to SQL in basics
Lec-w9-SQL.pptx Introduction to SQL in basics
zylzuht983
 
Creating Database 2010
Creating Database 2010
tgushi12
 
sdfsdfsdsdfsdfsdfsdfsdfsfdsfsdfsdfql.pdf
sdfsdfsdsdfsdfsdfsdfsdfsfdsfsdfsdfql.pdf
1mikhail2015
 
01 data modeling-and-er-diagrams
01 data modeling-and-er-diagrams
glubox
 
Complete SQL in one video by shradha.pdf
Complete SQL in one video by shradha.pdf
rahulashu699
 
Organisation of database Organisation of database
Organisation of database Organisation of database
praygodmwanga32
 
mySQL and Relational Databases
mySQL and Relational Databases
webhostingguy
 
Database queries
Database queries
IIUM
 
Presentation DBMS (1)
Presentation DBMS (1)
Ali Raza
 
1585625790_SQL-SESSION1.pptx
1585625790_SQL-SESSION1.pptx
MullaMainuddin
 
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
APMRETAIL
 
Info systems databases
Info systems databases
MR Z
 
Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statements
Steve Xu
 
Ad

More from sqlserver content (20)

MS SQL SERVER: Using the data mining tools
MS SQL SERVER: Using the data mining tools
sqlserver content
 
MS SQL SERVER: SSIS and data mining
MS SQL SERVER: SSIS and data mining
sqlserver content
 
MS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Programming sql server data mining
sqlserver content
 
MS SQL SERVER: Olap cubes and data mining
MS SQL SERVER: Olap cubes and data mining
sqlserver content
 
MS SQL SERVER: Microsoft time series algorithm
MS SQL SERVER: Microsoft time series algorithm
sqlserver content
 
MS SQL SERVER: Microsoft sequence clustering and association rules
MS SQL SERVER: Microsoft sequence clustering and association rules
sqlserver content
 
MS SQL SERVER: Neural network and logistic regression
MS SQL SERVER: Neural network and logistic regression
sqlserver content
 
MS SQL SERVER: Microsoft naive bayes algorithm
MS SQL SERVER: Microsoft naive bayes algorithm
sqlserver content
 
MS SQL SERVER: Decision trees algorithm
MS SQL SERVER: Decision trees algorithm
sqlserver content
 
MS SQL Server: Data mining concepts and dmx
MS SQL Server: Data mining concepts and dmx
sqlserver content
 
MS Sql Server: Reporting models
MS Sql Server: Reporting models
sqlserver content
 
MS Sql Server: Reporting manipulating data
MS Sql Server: Reporting manipulating data
sqlserver content
 
MS Sql Server: Reporting introduction
MS Sql Server: Reporting introduction
sqlserver content
 
MS Sql Server: Reporting basics
MS Sql Server: Reporting basics
sqlserver content
 
MS Sql Server: Datamining Introduction
MS Sql Server: Datamining Introduction
sqlserver content
 
MS Sql Server: Business Intelligence
MS Sql Server: Business Intelligence
sqlserver content
 
MS SQLSERVER:Feeding Data Into Database
MS SQLSERVER:Feeding Data Into Database
sqlserver content
 
MS SQLSERVER:Doing Calculations With Functions
MS SQLSERVER:Doing Calculations With Functions
sqlserver content
 
MS SQLSERVER:Deleting A Database
MS SQLSERVER:Deleting A Database
sqlserver content
 
MS SQLSERVER:Customizing Your D Base Design
MS SQLSERVER:Customizing Your D Base Design
sqlserver content
 
MS SQL SERVER: Using the data mining tools
MS SQL SERVER: Using the data mining tools
sqlserver content
 
MS SQL SERVER: SSIS and data mining
MS SQL SERVER: SSIS and data mining
sqlserver content
 
MS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Programming sql server data mining
sqlserver content
 
MS SQL SERVER: Olap cubes and data mining
MS SQL SERVER: Olap cubes and data mining
sqlserver content
 
MS SQL SERVER: Microsoft time series algorithm
MS SQL SERVER: Microsoft time series algorithm
sqlserver content
 
MS SQL SERVER: Microsoft sequence clustering and association rules
MS SQL SERVER: Microsoft sequence clustering and association rules
sqlserver content
 
MS SQL SERVER: Neural network and logistic regression
MS SQL SERVER: Neural network and logistic regression
sqlserver content
 
MS SQL SERVER: Microsoft naive bayes algorithm
MS SQL SERVER: Microsoft naive bayes algorithm
sqlserver content
 
MS SQL SERVER: Decision trees algorithm
MS SQL SERVER: Decision trees algorithm
sqlserver content
 
MS SQL Server: Data mining concepts and dmx
MS SQL Server: Data mining concepts and dmx
sqlserver content
 
MS Sql Server: Reporting models
MS Sql Server: Reporting models
sqlserver content
 
MS Sql Server: Reporting manipulating data
MS Sql Server: Reporting manipulating data
sqlserver content
 
MS Sql Server: Reporting introduction
MS Sql Server: Reporting introduction
sqlserver content
 
MS Sql Server: Reporting basics
MS Sql Server: Reporting basics
sqlserver content
 
MS Sql Server: Datamining Introduction
MS Sql Server: Datamining Introduction
sqlserver content
 
MS Sql Server: Business Intelligence
MS Sql Server: Business Intelligence
sqlserver content
 
MS SQLSERVER:Feeding Data Into Database
MS SQLSERVER:Feeding Data Into Database
sqlserver content
 
MS SQLSERVER:Doing Calculations With Functions
MS SQLSERVER:Doing Calculations With Functions
sqlserver content
 
MS SQLSERVER:Deleting A Database
MS SQLSERVER:Deleting A Database
sqlserver content
 
MS SQLSERVER:Customizing Your D Base Design
MS SQLSERVER:Customizing Your D Base Design
sqlserver content
 
Ad

Recently uploaded (20)

War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 

MS SQLSERVER:Creating A Database

  • 2. Creating a SQL Server DatabaseSTEPS IN CREATING A DATABASE IN 3 SIMPLE STEPS Understand the problem. Think of the essential data elements which are to become a part of the database Create the database using the SQL server 2008 – Command Prompt Feed data into the databaseLets take a look at how this can be done
  • 3. Step 1: Understand the problemAnalyze the problem and abstract the essential details that are to be storedFor example, if you wish to construct a database of the grocery items that are to be bought, the essential facts would be: Name of the item
  • 4. Type of the Item
  • 5. CostWe need not bother about the ‘less’ significant data like ISI certificate number or the Ingredients from a daily-user’s perspectiveBottom-line: Take the important stuff, ignore the rest.
  • 6. Step 2: Create the databaseThe Next step is to create the database schema. The schema (pronounced as skee-ma) is the structure of the database, which is described in a DBMS language like SQL.For the Grocery-Database, the schema of a table of items may look like:The Item number is a key, i.e., it is used to uniquely locate a product in a database.
  • 7. Step 2: Create the databaseSearching a DB Without a Primary Key: NOT EFFICIENTComputer: Now which out of these do you need?User: Search for ‘Milk’Database is searched and 2 entries match
  • 8. Step 2: Create the databaseSearching a DB witha Primary Key: EFFICIENTComputer: I got it! User: Search for Item with ID 102Database is searched and 1 entry matchesDB With a Primary KeyHence, always include primary keys in your DB deign
  • 9. Step 2: Create the databaseCreating the DB using SQL Server 2008 – Command Prompt
  • 10. Step 2: Create the databaseThe SQL Language consists of 3 major subsets, based on the nature of the commands:
  • 11. Step 2: Create the databaseThe SQL command for database creation falls under the DDL Language as it lets the user ‘define’ the database structure1.Open the SQL Server Command Prompt: Open Command Prompt: Click on START-> RUN-> Type ‘cmd’Activate SQL Command PromptType ‘sqlcmd’ in the command prompt that was opened
  • 12. Step 2: Create the database2.Type the Command The Syntax of the table-creation command is:create table <table-name> ( <fieldNamefieldTpye>,…);The Common Attributes/Fields types are:Number
  • 13. Eg: Product ID: 2324234
  • 17. It stands for ‘Variable length Character’
  • 19. Date:
  • 21. Step 2: Create the databaseFor example, consider a Grocery Item database:Field Type: NumberField Type: StringField Type: Float (Decimal)Field Type: DateSo, command for creation would be: create table itemlist (ItemID number, ItemName varchar2(15), cost float, dataofpurchase date);NOTE: Dont worry about the ‘case’ of the field-names. SQL is case insensitive.
  • 22. Step 2: Create the database3. Runthe Command In the SQL Command prompt, after typing the command:create table <table-name> ( <fieldNamefieldTpye>,…);1>Type ‘GO’ and press ENTER to run the SQL Server command:1> create table <table-name> ( <fieldNamefieldTpye>,…);2> go
  • 23. Summary3. Creating a Database: Analyze the scenario and decide on the structure
  • 24. Create the Database schema using SQL DDLVisit more self help tutorialsPick a tutorial of your choice and browse through it at your own pace.The tutorials section is free, self-guiding and will not involve any additional support.Visit us at www.dataminingtools.net