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
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
5. stored procedure and functions
PPTX
MS SQLSERVER:Joining Databases
Destiny Overview
JDeveloper - table relations
JDeveloper - create component
T.2.8.pp
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
5. stored procedure and functions
MS SQLSERVER:Joining Databases

Viewers also liked (7)

PPTX
Introduction To SQL Server 2014
PPTX
Chapter 4 functions, views, indexing
PPT
Sql server performance tuning
PPTX
Chapter 1 introduction to sql server
PDF
Stored-Procedures-Presentation
DOCX
Sqlserver 2012 installation step by step
PPTX
SQL Server 2012 and Big Data
Introduction To SQL Server 2014
Chapter 4 functions, views, indexing
Sql server performance tuning
Chapter 1 introduction to sql server
Stored-Procedures-Presentation
Sqlserver 2012 installation step by step
SQL Server 2012 and Big Data
Ad

Similar to MS SQLSERVER:Creating A Database (20)

PPT
Unit4_Lecture-sql.ppt and data science relate
PPTX
Database Management System - SQL beginner Training
PPTX
Lec-w9-SQL.pptx Introduction to SQL in basics
PPT
Creating Database 2010
PDF
sdfsdfsdsdfsdfsdfsdfsdfsfdsfsdfsdfql.pdf
PPTX
01 data modeling-and-er-diagrams
PDF
Complete SQL in one video by shradha.pdf
PPTX
Organisation of database Organisation of database
PPT
mySQL and Relational Databases
PPT
chapter 8 SQL.ppt
PPT
MySql slides (ppt)
DOC
Database queries
PPTX
Presentation DBMS (1)
PPT
Sql server T-sql basics ppt-3
PPTX
1585625790_SQL-SESSION1.pptx
PPTX
unit 1 ppt.pptx
PDF
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
PPT
Info systems databases
PDF
Sql server 2012 tutorials writing transact-sql statements
PPT
Presentation1
Unit4_Lecture-sql.ppt and data science relate
Database Management System - SQL beginner Training
Lec-w9-SQL.pptx Introduction to SQL in basics
Creating Database 2010
sdfsdfsdsdfsdfsdfsdfsdfsfdsfsdfsdfql.pdf
01 data modeling-and-er-diagrams
Complete SQL in one video by shradha.pdf
Organisation of database Organisation of database
mySQL and Relational Databases
chapter 8 SQL.ppt
MySql slides (ppt)
Database queries
Presentation DBMS (1)
Sql server T-sql basics ppt-3
1585625790_SQL-SESSION1.pptx
unit 1 ppt.pptx
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
Info systems databases
Sql server 2012 tutorials writing transact-sql statements
Presentation1
Ad

More from sqlserver content (20)

PPTX
MS SQL SERVER: Using the data mining tools
PPTX
MS SQL SERVER: SSIS and data mining
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 sequence clustering and association rules
PPTX
MS SQL SERVER: Neural network and logistic regression
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 Sql Server: Reporting introduction
PPTX
MS Sql Server: Reporting basics
PPTX
MS Sql Server: Datamining Introduction
PPTX
MS Sql Server: Business Intelligence
PPTX
MS SQLSERVER:Feeding Data Into Database
PPTX
MS SQLSERVER:Doing Calculations With Functions
PPTX
MS SQLSERVER:Deleting A Database
PPTX
MS SQLSERVER:Customizing Your D Base Design
MS SQL SERVER: Using the data mining tools
MS SQL SERVER: SSIS and data mining
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 sequence clustering and association rules
MS SQL SERVER: Neural network and logistic regression
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 Sql Server: Reporting introduction
MS Sql Server: Reporting basics
MS Sql Server: Datamining Introduction
MS Sql Server: Business Intelligence
MS SQLSERVER:Feeding Data Into Database
MS SQLSERVER:Doing Calculations With Functions
MS SQLSERVER:Deleting A Database
MS SQLSERVER:Customizing Your D Base Design

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPT
Teaching material agriculture food technology
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
20250228 LYD VKU AI Blended-Learning.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
“AI and Expert System Decision Support & Business Intelligence Systems”
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Chapter 3 Spatial Domain Image Processing.pdf
The AUB Centre for AI in Media Proposal.docx
Assigned Numbers - 2025 - Bluetooth® Document
Teaching material agriculture food technology
A comparative analysis of optical character recognition models for extracting...
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
Programs and apps: productivity, graphics, security and other tools
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
MIND Revenue Release Quarter 2 2025 Press Release

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