SlideShare ist ein Scribd-Unternehmen logo
1 von 14
3 SQL SERVER: CREATINGA DATABASE
Creating a SQL Server Database STEPS 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 database Lets  take a look at how this can be done
Step 1: Understand the problem Analyze the problem and abstract the essential details that are to be stored For example, if you wish to construct a database of the grocery items that are to be bought, the essential facts would be: ,[object Object]
 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 perspective Bottom-line: Take the important stuff, ignore the rest.
Step 2: Create the database The 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 database Searching a DB Without a Primary Key: NOT EFFICIENT Computer: Now which out of these do you need? User: Search for ‘Milk’ Database is searched and 2 entries match
Step 2: Create the database Searching a DB witha Primary Key: EFFICIENT Computer: I got it!  User: Search for Item with ID 102 Database is searched and 1 entry matches DB With a Primary Key Hence, always include primary keys in your DB deign
Step 2: Create the database Creating the DB using SQL Server 2008 – Command Prompt
Step 2: Create the database The SQL Language consists of 3 major subsets, based on the nature of the commands:
Step 2: Create the database The SQL command for database creation falls under the DDL Language as it lets the user ‘define’ the database structure 1.Open the SQL Server Command Prompt: ,[object Object],Click on START-> RUN-> Type ‘cmd’ ,[object Object],Type ‘sqlcmd’ in the command prompt that was opened
Step 2: Create the database 2.Type the Command 	The Syntax of the table-creation command is: create table <table-name> ( <fieldNamefieldTpye>,…); The Common Attributes/Fields types are: ,[object Object]
Eg: Product ID: 2324234
Float (decimals)

Weitere ähnliche Inhalte

Andere mochten auch

Asha & Beckis Nc Presentation
Asha & Beckis Nc PresentationAsha & Beckis Nc Presentation
Asha & Beckis Nc Presentation
Asha Stremcha
 
Presentazione oroblu
Presentazione orobluPresentazione oroblu
Presentazione oroblu
robyroby65
 

Andere mochten auch (20)

Tables And SQL basics
Tables And SQL basicsTables And SQL basics
Tables And SQL basics
 
2017 Server & Database Brand Leader Mini Report
2017 Server & Database Brand Leader Mini Report2017 Server & Database Brand Leader Mini Report
2017 Server & Database Brand Leader Mini Report
 
Steering system 7
Steering system 7Steering system 7
Steering system 7
 
Sql queries
Sql queriesSql queries
Sql queries
 
100 sql queries
100 sql queries100 sql queries
100 sql queries
 
BI: Open Source
BI: Open SourceBI: Open Source
BI: Open Source
 
Survival Strategies For Testers
Survival Strategies For TestersSurvival Strategies For Testers
Survival Strategies For Testers
 
Introduction to Data-Applied
Introduction to Data-AppliedIntroduction to Data-Applied
Introduction to Data-Applied
 
Data Applied: Clustering
Data Applied: ClusteringData Applied: Clustering
Data Applied: Clustering
 
SPSS: Data Editor
SPSS: Data EditorSPSS: Data Editor
SPSS: Data Editor
 
Asha & Beckis Nc Presentation
Asha & Beckis Nc PresentationAsha & Beckis Nc Presentation
Asha & Beckis Nc Presentation
 
RapidMiner: Setting Up A Process
RapidMiner: Setting Up A ProcessRapidMiner: Setting Up A Process
RapidMiner: Setting Up A Process
 
MS Sql Server: Reporting introduction
MS Sql Server: Reporting introductionMS Sql Server: Reporting introduction
MS Sql Server: Reporting introduction
 
LISP: Declarations In Lisp
LISP: Declarations In LispLISP: Declarations In Lisp
LISP: Declarations In Lisp
 
Presentazione oroblu
Presentazione orobluPresentazione oroblu
Presentazione oroblu
 
Retrieving Data From A Database
Retrieving Data From A DatabaseRetrieving Data From A Database
Retrieving Data From A Database
 
InfoChimps.Org
InfoChimps.OrgInfoChimps.Org
InfoChimps.Org
 
R Datatypes
R DatatypesR Datatypes
R Datatypes
 
Welcome
WelcomeWelcome
Welcome
 
XL-Miner: Timeseries
XL-Miner: TimeseriesXL-Miner: Timeseries
XL-Miner: Timeseries
 

Ähnlich wie MS Sql Server: Creating A Database

Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docxLab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
VinaOconner450
 
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
BUSI 301 Book Review RubricScoreCommentsResearch 25.docxBUSI 301 Book Review RubricScoreCommentsResearch 25.docx
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
humphrieskalyn
 
It203 class slides-unit5
It203 class slides-unit5It203 class slides-unit5
It203 class slides-unit5
Matthew Moldvan
 
Kevin Bengtson Portfolio
Kevin Bengtson PortfolioKevin Bengtson Portfolio
Kevin Bengtson Portfolio
Kbengt521
 
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docxLab 2 Work with Dictionary and Create Relational Database (60 pts.docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docx
DIPESH30
 
Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials   writing transact-sql statementsSql server 2012 tutorials   writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statements
Steve Xu
 
Creating and editing a database
Creating and editing a databaseCreating and editing a database
Creating and editing a database
crystalpullen
 

Ähnlich wie MS Sql Server: Creating A Database (20)

Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docxLab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
 
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
BUSI 301 Book Review RubricScoreCommentsResearch 25.docxBUSI 301 Book Review RubricScoreCommentsResearch 25.docx
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
 
It203 class slides-unit5
It203 class slides-unit5It203 class slides-unit5
It203 class slides-unit5
 
Kevin Bengtson Portfolio
Kevin Bengtson PortfolioKevin Bengtson Portfolio
Kevin Bengtson Portfolio
 
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docxLab 2 Work with Dictionary and Create Relational Database (60 pts.docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docx
 
SQL212.3 Introduction to SQL using Oracle Module 3
SQL212.3 Introduction to SQL using Oracle Module 3SQL212.3 Introduction to SQL using Oracle Module 3
SQL212.3 Introduction to SQL using Oracle Module 3
 
FI task.pdf
FI task.pdfFI task.pdf
FI task.pdf
 
7376211EC132-DHAYAL-FI task.pdf
7376211EC132-DHAYAL-FI task.pdf7376211EC132-DHAYAL-FI task.pdf
7376211EC132-DHAYAL-FI task.pdf
 
Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials   writing transact-sql statementsSql server 2012 tutorials   writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statements
 
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
 
SQL200.3 Module 3
SQL200.3 Module 3SQL200.3 Module 3
SQL200.3 Module 3
 
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
 
Physical Design and Development
Physical Design and DevelopmentPhysical Design and Development
Physical Design and Development
 
Sql Portfolio
Sql PortfolioSql Portfolio
Sql Portfolio
 
Creating and editing a database
Creating and editing a databaseCreating and editing a database
Creating and editing a database
 
SQL Server 2008 Portfolio
SQL Server 2008 PortfolioSQL Server 2008 Portfolio
SQL Server 2008 Portfolio
 
SQL Query Interview Questions
SQL Query Interview QuestionsSQL Query Interview Questions
SQL Query Interview Questions
 
lab56_db
lab56_dblab56_db
lab56_db
 
lab56_db
lab56_dblab56_db
lab56_db
 
Create Components in TomatoCMS
Create Components in TomatoCMSCreate Components in TomatoCMS
Create Components in TomatoCMS
 

Mehr von DataminingTools Inc

Mehr von DataminingTools Inc (20)

Terminology Machine Learning
Terminology Machine LearningTerminology Machine Learning
Terminology Machine Learning
 
Techniques Machine Learning
Techniques Machine LearningTechniques Machine Learning
Techniques Machine Learning
 
Machine learning Introduction
Machine learning IntroductionMachine learning Introduction
Machine learning Introduction
 
Areas of machine leanring
Areas of machine leanringAreas of machine leanring
Areas of machine leanring
 
AI: Planning and AI
AI: Planning and AIAI: Planning and AI
AI: Planning and AI
 
AI: Logic in AI 2
AI: Logic in AI 2AI: Logic in AI 2
AI: Logic in AI 2
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
 
AI: Learning in AI 2
AI: Learning in AI 2AI: Learning in AI 2
AI: Learning in AI 2
 
AI: Learning in AI
AI: Learning in AI AI: Learning in AI
AI: Learning in AI
 
AI: Introduction to artificial intelligence
AI: Introduction to artificial intelligenceAI: Introduction to artificial intelligence
AI: Introduction to artificial intelligence
 
AI: Belief Networks
AI: Belief NetworksAI: Belief Networks
AI: Belief Networks
 
AI: AI & Searching
AI: AI & SearchingAI: AI & Searching
AI: AI & Searching
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
 
Data Mining: Text and web mining
Data Mining: Text and web miningData Mining: Text and web mining
Data Mining: Text and web mining
 
Data Mining: Outlier analysis
Data Mining: Outlier analysisData Mining: Outlier analysis
Data Mining: Outlier analysis
 
Data Mining: Mining stream time series and sequence data
Data Mining: Mining stream time series and sequence dataData Mining: Mining stream time series and sequence data
Data Mining: Mining stream time series and sequence data
 
Data Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlationsData Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlations
 
Data Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysisData Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysis
 
Data warehouse and olap technology
Data warehouse and olap technologyData warehouse and olap technology
Data warehouse and olap technology
 
Data Mining: Data processing
Data Mining: Data processingData Mining: Data processing
Data Mining: Data processing
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

MS Sql Server: Creating A Database

  • 1. 3 SQL SERVER: CREATINGA DATABASE
  • 2. Creating a SQL Server Database STEPS 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 database Lets take a look at how this can be done
  • 3.
  • 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 perspective Bottom-line: Take the important stuff, ignore the rest.
  • 6. Step 2: Create the database The 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 database Searching a DB Without a Primary Key: NOT EFFICIENT Computer: Now which out of these do you need? User: Search for ‘Milk’ Database is searched and 2 entries match
  • 8. Step 2: Create the database Searching a DB witha Primary Key: EFFICIENT Computer: I got it!  User: Search for Item with ID 102 Database is searched and 1 entry matches DB With a Primary Key Hence, always include primary keys in your DB deign
  • 9. Step 2: Create the database Creating the DB using SQL Server 2008 – Command Prompt
  • 10. Step 2: Create the database The SQL Language consists of 3 major subsets, based on the nature of the commands:
  • 11.
  • 12.
  • 13. Eg: Product ID: 2324234
  • 17. It stands for ‘Variable length Character’
  • 19. Date:
  • 21. Step 2: Create the database For example, consider a Grocery Item database: Field Type: Number Field Type: String Field Type: Float (Decimal) Field Type: Date So, 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 database 3. 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.
  • 24.