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

PPT
Destiny Overview
PPTX
JDeveloper - table relations
PPTX
JDeveloper - create component
PPTX
T.2.8.pp
PPTX
MS Sql Server: Datamining Introduction
PPTX
MS Sql Server: Business Intelligence
PPTX
MS SQL SERVER: Microsoft sequence clustering and association rules
PPTX
MS Sql Server: Reporting basics
Destiny Overview
JDeveloper - table relations
JDeveloper - create component
T.2.8.pp
MS Sql Server: Datamining Introduction
MS Sql Server: Business Intelligence
MS SQL SERVER: Microsoft sequence clustering and association rules
MS Sql Server: Reporting basics

Viewers also liked (11)

PPTX
MS SQL SERVER: Introduction To Database Concepts
PPTX
MS SQLSERVER:Manipulating Database
PPTX
MS SQLSERVER:Doing Calculations With Functions
PPTX
MS SQLSERVER:Feeding Data Into Database
PPTX
MS SQLSERVER:Retrieving Data From A Database
PPTX
MS Sql Server: Reporting introduction
PPTX
MS SQL SERVER: Neural network and logistic regression
PPTX
MS SQL SERVER: Using the data mining tools
PPTX
MS SQL SERVER: SSIS and data mining
PPTX
MS SQLSERVER:Joining Databases
PPTX
MS SQL SERVER: Getting Started With Sql Server 2008
MS SQL SERVER: Introduction To Database Concepts
MS SQLSERVER:Manipulating Database
MS SQLSERVER:Doing Calculations With Functions
MS SQLSERVER:Feeding Data Into Database
MS SQLSERVER:Retrieving Data From A Database
MS Sql Server: Reporting introduction
MS SQL SERVER: Neural network and logistic regression
MS SQL SERVER: Using the data mining tools
MS SQL SERVER: SSIS and data mining
MS SQLSERVER:Joining Databases
MS SQL SERVER: Getting Started With Sql Server 2008
Ad

Similar to MS SQL SERVER: Creating A Database (20)

DOCX
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
DOCX
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
PPT
It203 class slides-unit5
DOCX
How to design a database that include planning
PDF
Complete SQL in one video by shradha.pdf
PPT
Kevin Bengtson Portfolio
DOCX
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docx
PPT
SQL212.3 Introduction to SQL using Oracle Module 3
PDF
FI task.pdf
PDF
7376211EC132-DHAYAL-FI task.pdf
PDF
Sql server 2012 tutorials writing transact-sql statements
PDF
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
PPT
SQL200.3 Module 3
PPT
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
PPTX
Physical Design and Development
PPT
Sql Portfolio
PPT
Creating and editing a database
PPTX
presentasi romi-java-06-database-october2013.pptx
PPTX
SQL Server 2008 Portfolio
PDF
SQL Query Interview Questions
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
It203 class slides-unit5
How to design a database that include planning
Complete SQL in one video by shradha.pdf
Kevin Bengtson Portfolio
Lab 2 Work with Dictionary and Create Relational Database (60 pts.docx
SQL212.3 Introduction to SQL using Oracle Module 3
FI task.pdf
7376211EC132-DHAYAL-FI task.pdf
Sql server 2012 tutorials writing transact-sql statements
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
SQL200.3 Module 3
SQL202.3 Accelerated Introduction to SQL Using SQL Server Module 3
Physical Design and Development
Sql Portfolio
Creating and editing a database
presentasi romi-java-06-database-october2013.pptx
SQL Server 2008 Portfolio
SQL Query Interview Questions
Ad

More from sqlserver content (17)

PPTX
MS SQL SERVER: Programming sql server data mining
PPTX
MS SQL SERVER: Olap cubes and data mining
PPTX
MS SQL SERVER: Microsoft time series algorithm
PPTX
MS SQL SERVER: Microsoft naive bayes algorithm
PPTX
MS SQL SERVER: Decision trees algorithm
PPTX
MS SQL Server: Data mining concepts and dmx
PPTX
MS Sql Server: Reporting models
PPTX
MS Sql Server: Reporting manipulating data
PPTX
MS SQLSERVER:Deleting A Database
PPTX
MS SQLSERVER:Customizing Your D Base Design
PPTX
MS SQLSERVER:Creating Views
PPTX
MS SQLSERVER:Creating A Database
PPTX
MS SQLSERVER:Advanced Query Concepts Copy
PPTX
MS SQLSERVER:Sql Functions And Procedures
PPTX
MS SQL SERVER: Sql Functions And Procedures
PPTX
MS SQL SERVER: Retrieving Data From A Database
PPTX
MS SQL SERVER: Manipulating Database
MS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Olap cubes and data mining
MS SQL SERVER: Microsoft time series algorithm
MS SQL SERVER: Microsoft naive bayes algorithm
MS SQL SERVER: Decision trees algorithm
MS SQL Server: Data mining concepts and dmx
MS Sql Server: Reporting models
MS Sql Server: Reporting manipulating data
MS SQLSERVER:Deleting A Database
MS SQLSERVER:Customizing Your D Base Design
MS SQLSERVER:Creating Views
MS SQLSERVER:Creating A Database
MS SQLSERVER:Advanced Query Concepts Copy
MS SQLSERVER:Sql Functions And Procedures
MS SQL SERVER: Sql Functions And Procedures
MS SQL SERVER: Retrieving Data From A Database
MS SQL SERVER: Manipulating Database

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Spectral efficient network and resource selection model in 5G networks
PPT
Teaching material agriculture food technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Machine Learning_overview_presentation.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Electronic commerce courselecture one. Pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
cuic standard and advanced reporting.pdf
A comparative analysis of optical character recognition models for extracting...
Spectral efficient network and resource selection model in 5G networks
Teaching material agriculture food technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
MYSQL Presentation for SQL database connectivity
Mobile App Security Testing_ A Comprehensive Guide.pdf
Review of recent advances in non-invasive hemoglobin estimation
Machine Learning_overview_presentation.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
The AUB Centre for AI in Media Proposal.docx
Digital-Transformation-Roadmap-for-Companies.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Chapter 3 Spatial Domain Image Processing.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Electronic commerce courselecture one. Pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”

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