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)

More Related Content

Viewers also liked (20)

PPT
Tables And SQL basics
Amit Kumar Singh
 
PDF
2017 Server & Database Brand Leader Mini Report
IT Brand Pulse
 
PPTX
Steering system 7
Kanhaiyya Patil
 
DOC
Sql queries
narendrababuc
 
PPTX
100 sql queries
Srinimf-Slides
 
PPTX
BI: Open Source
DataminingTools Inc
 
PPT
Survival Strategies For Testers
Erik Altena
 
PPTX
Introduction to Data-Applied
DataminingTools Inc
 
PPTX
Data Applied: Clustering
DataminingTools Inc
 
PPTX
SPSS: Data Editor
DataminingTools Inc
 
PPT
Asha & Beckis Nc Presentation
Asha Stremcha
 
PPTX
RapidMiner: Setting Up A Process
DataminingTools Inc
 
PPTX
MS Sql Server: Reporting introduction
DataminingTools Inc
 
PPTX
LISP: Declarations In Lisp
DataminingTools Inc
 
ODP
Presentazione oroblu
robyroby65
 
PPTX
Retrieving Data From A Database
DataminingTools Inc
 
PPTX
InfoChimps.Org
DataminingTools Inc
 
PPTX
R Datatypes
DataminingTools Inc
 
PPTX
Welcome
DataminingTools Inc
 
PPTX
XL-Miner: Timeseries
DataminingTools Inc
 
Tables And SQL basics
Amit Kumar Singh
 
2017 Server & Database Brand Leader Mini Report
IT Brand Pulse
 
Steering system 7
Kanhaiyya Patil
 
Sql queries
narendrababuc
 
100 sql queries
Srinimf-Slides
 
BI: Open Source
DataminingTools Inc
 
Survival Strategies For Testers
Erik Altena
 
Introduction to Data-Applied
DataminingTools Inc
 
Data Applied: Clustering
DataminingTools Inc
 
SPSS: Data Editor
DataminingTools Inc
 
Asha & Beckis Nc Presentation
Asha Stremcha
 
RapidMiner: Setting Up A Process
DataminingTools Inc
 
MS Sql Server: Reporting introduction
DataminingTools Inc
 
LISP: Declarations In Lisp
DataminingTools Inc
 
Presentazione oroblu
robyroby65
 
Retrieving Data From A Database
DataminingTools Inc
 
InfoChimps.Org
DataminingTools Inc
 
R Datatypes
DataminingTools Inc
 
XL-Miner: Timeseries
DataminingTools Inc
 

Similar to MS Sql Server: Creating A Database (20)

DOCX
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
VinaOconner450
 
DOCX
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
humphrieskalyn
 
PPT
It203 class slides-unit5
Matthew Moldvan
 
DOCX
How to design a database that include planning
Kamal Golan
 
PDF
Complete SQL in one video by shradha.pdf
rahulashu699
 
PPT
Kevin Bengtson Portfolio
Kbengt521
 
DOCX
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docx
DIPESH30
 
PPT
SQL212.3 Introduction to SQL using Oracle Module 3
Dan D'Urso
 
PDF
FI task.pdf
DHAYALK1
 
PDF
7376211EC132-DHAYAL-FI task.pdf
DHAYALK1
 
PDF
Sql server 2012 tutorials writing transact-sql statements
Steve Xu
 
PDF
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Mumbai B.Sc.IT Study
 
PPT
SQL200.3 Module 3
Dan D'Urso
 
PPT
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
Dan D'Urso
 
PPTX
Physical Design and Development
Er. Nawaraj Bhandari
 
PPT
Sql Portfolio
Shelli Ciaschini
 
PPT
Creating and editing a database
crystalpullen
 
PPTX
presentasi romi-java-06-database-october2013.pptx
steeveenn
 
PPTX
SQL Server 2008 Portfolio
lilredlokita
 
PDF
SQL Query Interview Questions
soniajessica2
 
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
VinaOconner450
 
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
humphrieskalyn
 
It203 class slides-unit5
Matthew Moldvan
 
How to design a database that include planning
Kamal Golan
 
Complete SQL in one video by shradha.pdf
rahulashu699
 
Kevin Bengtson Portfolio
Kbengt521
 
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docx
DIPESH30
 
SQL212.3 Introduction to SQL using Oracle Module 3
Dan D'Urso
 
FI task.pdf
DHAYALK1
 
7376211EC132-DHAYAL-FI task.pdf
DHAYALK1
 
Sql server 2012 tutorials writing transact-sql statements
Steve Xu
 
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Mumbai B.Sc.IT Study
 
SQL200.3 Module 3
Dan D'Urso
 
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
Dan D'Urso
 
Physical Design and Development
Er. Nawaraj Bhandari
 
Sql Portfolio
Shelli Ciaschini
 
Creating and editing a database
crystalpullen
 
presentasi romi-java-06-database-october2013.pptx
steeveenn
 
SQL Server 2008 Portfolio
lilredlokita
 
SQL Query Interview Questions
soniajessica2
 
Ad

More from DataminingTools Inc (20)

PPTX
Terminology Machine Learning
DataminingTools Inc
 
PPTX
Techniques Machine Learning
DataminingTools Inc
 
PPTX
Machine learning Introduction
DataminingTools Inc
 
PPTX
Areas of machine leanring
DataminingTools Inc
 
PPTX
AI: Planning and AI
DataminingTools Inc
 
PPTX
AI: Logic in AI 2
DataminingTools Inc
 
PPTX
AI: Logic in AI
DataminingTools Inc
 
PPTX
AI: Learning in AI 2
DataminingTools Inc
 
PPTX
AI: Learning in AI
DataminingTools Inc
 
PPTX
AI: Introduction to artificial intelligence
DataminingTools Inc
 
PPTX
AI: Belief Networks
DataminingTools Inc
 
PPTX
AI: AI & Searching
DataminingTools Inc
 
PPTX
AI: AI & Problem Solving
DataminingTools Inc
 
PPTX
Data Mining: Text and web mining
DataminingTools Inc
 
PPTX
Data Mining: Outlier analysis
DataminingTools Inc
 
PPTX
Data Mining: Mining stream time series and sequence data
DataminingTools Inc
 
PPTX
Data Mining: Mining ,associations, and correlations
DataminingTools Inc
 
PPTX
Data Mining: Graph mining and social network analysis
DataminingTools Inc
 
PPTX
Data warehouse and olap technology
DataminingTools Inc
 
PPTX
Data Mining: Data processing
DataminingTools Inc
 
Terminology Machine Learning
DataminingTools Inc
 
Techniques Machine Learning
DataminingTools Inc
 
Machine learning Introduction
DataminingTools Inc
 
Areas of machine leanring
DataminingTools Inc
 
AI: Planning and AI
DataminingTools Inc
 
AI: Logic in AI 2
DataminingTools Inc
 
AI: Logic in AI
DataminingTools Inc
 
AI: Learning in AI 2
DataminingTools Inc
 
AI: Learning in AI
DataminingTools Inc
 
AI: Introduction to artificial intelligence
DataminingTools Inc
 
AI: Belief Networks
DataminingTools Inc
 
AI: AI & Searching
DataminingTools Inc
 
AI: AI & Problem Solving
DataminingTools Inc
 
Data Mining: Text and web mining
DataminingTools Inc
 
Data Mining: Outlier analysis
DataminingTools Inc
 
Data Mining: Mining stream time series and sequence data
DataminingTools Inc
 
Data Mining: Mining ,associations, and correlations
DataminingTools Inc
 
Data Mining: Graph mining and social network analysis
DataminingTools Inc
 
Data warehouse and olap technology
DataminingTools Inc
 
Data Mining: Data processing
DataminingTools Inc
 
Ad

Recently uploaded (20)

PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
Governing Geospatial Data at Scale: Optimizing ArcGIS Online with FME in Envi...
Safe Software
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Draugnet: Anonymous Threat Reporting for a World on Fire
treyka
 
PDF
FME in Overdrive: Unleashing the Power of Parallel Processing
Safe Software
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
PDF
Deploy Faster, Run Smarter: Learn Containers with QNAP
QNAP Marketing
 
PDF
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PPTX
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Governing Geospatial Data at Scale: Optimizing ArcGIS Online with FME in Envi...
Safe Software
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Draugnet: Anonymous Threat Reporting for a World on Fire
treyka
 
FME in Overdrive: Unleashing the Power of Parallel Processing
Safe Software
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
Deploy Faster, Run Smarter: Learn Containers with QNAP
QNAP Marketing
 
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Practical Applications of AI in Local Government
OnBoard
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 

MS Sql Server: 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