SlideShare a Scribd company logo
1 of 20
Download to read offline
CIS282
Database Server
 Operates as a separate “process”
 Need to communicate with the server using a separate
 application
   Connection required to transmit request and response
   Management Studio and SQL Server are different
    programs
Managing SQL Server
 Management Studio gives access to most
  functions/operations
 Query window provides method to write/execute T-
  SQL statements
   “T” = transact
 SQL Service Manager provides way to start/stop Server
SQL Server Databases
 Two files are maintained
    Data file (.mdf)
    Transaction Log file (.ldf)
 Files can be spread over multiple machines
    Always need a primary file group
Database Contents
 Tables
    User tables hold data
    System tables hold data about the database
 Stored Procedures, User Defined Functions
 Views
 Indexes
Default Databases
 Master: Logins/User roles; system configuration;
  names/locations of databases; SQL Server startup
 Tempdb: Lasts duration of SQL Server session;
  temporary holding space
 Model: Sets characteristics of new databases
 MSDB: Holds information about jobs SQL Server
  Agent runs
Security
 Windows Authentication: Windows network logins
    used
   Mixed-mode: Windows OR SQL Server logins used
   Login: To access server
   User: To access a database
   Network security trumps all….
Roles
 Server – administrative functions
    Task based:
     Backup
     Create database
   Roles are fixed
 Database/Application – groups of users with common
 activities
   Read/write all data
   Read/write select data
   Read data only
Normalization
 Process for reducing duplicate and redundant data
 1st Normal Form: eliminate repeating groups
 2nd Normal Form: each column in a table depends on
  the primary key
    can’t get information with only part of the key
 3rd Normal Form: A column cannot be dependent on
  another column that isn’t the primary key
Relationships
 Types
    One-to-one
    One-to-many
    Many-to-many
 Requires a primary key on the ‘one’ side, foreign key on
  the ‘many’ side
 Referential Integrity defines how values work across
  tables
Table Definition
 Fields need a name and datatype
    SQL Server datatypes are different from Access and
     procedural programming language datatypes
 Fieldnames can include spaces – but poor practice
 Identity – create unique number for each row
Constraints
 Allow Null – value not required to add record
 Check Constraints – test field or row values
 Default value – if no data is entered into a field
 Unique – values must be different for each row
Database Diagrams
 Illustrate database design
 Add, modify tables, indexes, relationships
 Can control view, table details
Indexes
 Help to select and find records
 Serve as a “cross-reference”
 Can be based on one or more fields
Good Index Characteristics
 Low maintenance columns
 Includes columns used frequently in Where or Order
  By clauses
 Don’t have to go out to table for data
 Help search for ranges of records
Action Queries
 Insert: insert into tablename(fieldlist) values(valuelist)
 Update: update tablename set
  field1=value1, field2=value2
 Delete: delete from tablename [where condition]
Select Statement
 Can use an alias for fields and/or tables
 Select fields
 From table
    Join table On field=field
        Inner – both tables have records with
         matching values
        Outer – all records from one table and any
         matches found in second table
Where
 Conditions to determine records returned
 Multiple conditions require And … Or
 Can use where clause to implement join between
  tables
 Sub-queries allow tables to be limited by values in a
  second table without using a join
Views
 Pre-defined select statement
 Used like a virtual table

SELECT * FROM v_CurrentEmployees
View Performance
 By default views run just as a query processed from
  command line
   Adds second step to execution:
       select from view
       execute view itself
 Can add an index to speed execution
    Specific requirements when creating an index on a view

More Related Content

What's hot

Oracle SQL - Select Part -1 let's write some queries!
Oracle SQL - Select Part -1  let's write some queries!Oracle SQL - Select Part -1  let's write some queries!
Oracle SQL - Select Part -1 let's write some queries!A Data Guru
 
Relational Database Management System part II
Relational Database Management System part IIRelational Database Management System part II
Relational Database Management System part IIKavithaA19
 
Dbms Interview Question And Answer
Dbms Interview Question And AnswerDbms Interview Question And Answer
Dbms Interview Question And AnswerJagan Mohan Bishoyi
 
Structured query language
Structured query languageStructured query language
Structured query languageRashid Ansari
 
Bt0075 rdbms with mysql 1
Bt0075 rdbms with mysql 1Bt0075 rdbms with mysql 1
Bt0075 rdbms with mysql 1Techglyphs
 
Overview spss instructor
Overview spss instructorOverview spss instructor
Overview spss instructoraswhite
 
IMPORT AND EXPORT UTILITIES IN MS-ACCESS
IMPORT AND EXPORT UTILITIES IN MS-ACCESSIMPORT AND EXPORT UTILITIES IN MS-ACCESS
IMPORT AND EXPORT UTILITIES IN MS-ACCESS23HARSHU
 

What's hot (20)

advanced sql(database)
advanced sql(database)advanced sql(database)
advanced sql(database)
 
12 SQL
12 SQL12 SQL
12 SQL
 
Data concepts
Data conceptsData concepts
Data concepts
 
[PHPUGPH] PHP Roadshow - MySQL
[PHPUGPH] PHP Roadshow - MySQL[PHPUGPH] PHP Roadshow - MySQL
[PHPUGPH] PHP Roadshow - MySQL
 
Transaction
TransactionTransaction
Transaction
 
Oracle SQL - Select Part -1 let's write some queries!
Oracle SQL - Select Part -1  let's write some queries!Oracle SQL - Select Part -1  let's write some queries!
Oracle SQL - Select Part -1 let's write some queries!
 
Relational Database Management System part II
Relational Database Management System part IIRelational Database Management System part II
Relational Database Management System part II
 
Ch 9 S Q L
Ch 9  S Q LCh 9  S Q L
Ch 9 S Q L
 
Dbms Interview Question And Answer
Dbms Interview Question And AnswerDbms Interview Question And Answer
Dbms Interview Question And Answer
 
Ch1- Introduction to dbms
Ch1- Introduction to dbmsCh1- Introduction to dbms
Ch1- Introduction to dbms
 
Structured query language
Structured query languageStructured query language
Structured query language
 
Bt0075 rdbms with mysql 1
Bt0075 rdbms with mysql 1Bt0075 rdbms with mysql 1
Bt0075 rdbms with mysql 1
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
Overview spss instructor
Overview spss instructorOverview spss instructor
Overview spss instructor
 
7 files
7 files7 files
7 files
 
Sap abap
Sap abapSap abap
Sap abap
 
Physical Design and Development
Physical Design and DevelopmentPhysical Design and Development
Physical Design and Development
 
Oracle SQL Part 2
Oracle SQL Part 2Oracle SQL Part 2
Oracle SQL Part 2
 
SQL DDL
SQL DDLSQL DDL
SQL DDL
 
IMPORT AND EXPORT UTILITIES IN MS-ACCESS
IMPORT AND EXPORT UTILITIES IN MS-ACCESSIMPORT AND EXPORT UTILITIES IN MS-ACCESS
IMPORT AND EXPORT UTILITIES IN MS-ACCESS
 

Viewers also liked (6)

Cis145 Final Review
Cis145 Final ReviewCis145 Final Review
Cis145 Final Review
 
Stored procedures
Stored proceduresStored procedures
Stored procedures
 
CIS160 final review
CIS160 final reviewCIS160 final review
CIS160 final review
 
3 sql overview
3 sql overview3 sql overview
3 sql overview
 
Normalization
NormalizationNormalization
Normalization
 
SQL Constraints
SQL ConstraintsSQL Constraints
SQL Constraints
 

Similar to CIS282 Midterm review (20)

CIS 282 Final Review
CIS 282 Final ReviewCIS 282 Final Review
CIS 282 Final Review
 
Data Base Management System.pdf
Data Base Management System.pdfData Base Management System.pdf
Data Base Management System.pdf
 
Basics on SQL queries
Basics on SQL queriesBasics on SQL queries
Basics on SQL queries
 
SQL Server Intro
SQL Server IntroSQL Server Intro
SQL Server Intro
 
Module02
Module02Module02
Module02
 
Introduction to dbms
Introduction to dbmsIntroduction to dbms
Introduction to dbms
 
CIS145 Final Review
CIS145 Final ReviewCIS145 Final Review
CIS145 Final Review
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statements
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancements
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldev
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developers
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
Working with designers
Working with designersWorking with designers
Working with designers
 
Access 2 day course
Access 2 day courseAccess 2 day course
Access 2 day course
 
7. SQL.pptx
7. SQL.pptx7. SQL.pptx
7. SQL.pptx
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
RDBMS SQL Basics
RDBMS SQL BasicsRDBMS SQL Basics
RDBMS SQL Basics
 
Database Basics
Database BasicsDatabase Basics
Database Basics
 

More from Randy Riness @ South Puget Sound Community College

More from Randy Riness @ South Puget Sound Community College (20)

CIS 245 Final Review
CIS 245 Final ReviewCIS 245 Final Review
CIS 245 Final Review
 
Cis166 Final Review C#
Cis166 Final Review C#Cis166 Final Review C#
Cis166 Final Review C#
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
CIS245 sql
CIS245 sqlCIS245 sql
CIS245 sql
 
Cis245 Midterm Review
Cis245 Midterm ReviewCis245 Midterm Review
Cis245 Midterm Review
 
CSS
CSSCSS
CSS
 
XPath
XPathXPath
XPath
 
XSLT Overview
XSLT OverviewXSLT Overview
XSLT Overview
 
Views
ViewsViews
Views
 
Schemas 2 - Restricting Values
Schemas 2 - Restricting ValuesSchemas 2 - Restricting Values
Schemas 2 - Restricting Values
 
CIS 145 test 1 review
CIS 145 test 1 reviewCIS 145 test 1 review
CIS 145 test 1 review
 
XML schemas
XML schemasXML schemas
XML schemas
 
Document type definitions part 2
Document type definitions part 2Document type definitions part 2
Document type definitions part 2
 
Document type definitions part 1
Document type definitions part 1Document type definitions part 1
Document type definitions part 1
 
DOM specifics
DOM specificsDOM specifics
DOM specifics
 
SQL overview and software
SQL overview and softwareSQL overview and software
SQL overview and software
 
Cis166 final review c#
Cis166 final review c#Cis166 final review c#
Cis166 final review c#
 
Triggers
TriggersTriggers
Triggers
 
SQL Server Stored procedures
SQL Server Stored proceduresSQL Server Stored procedures
SQL Server Stored procedures
 
SQL Server Views
SQL Server ViewsSQL Server Views
SQL Server Views
 

Recently uploaded

In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesMohammad Hassany
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxSaurabhParmar42
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxraviapr7
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and stepobaje godwin sunday
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17Celine George
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxMYDA ANGELICA SUAN
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17Celine George
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxheathfieldcps1
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.EnglishCEIPdeSigeiro
 
How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17Celine George
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapitolTechU
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfTechSoup
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphNetziValdelomar1
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptxraviapr7
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfMohonDas
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptxSandy Millin
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17Celine George
 

Recently uploaded (20)

In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming Classes
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptx
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptx
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and step
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17
 
Finals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quizFinals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quiz
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptx
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptx
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
 
How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptx
 
Prelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quizPrelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quiz
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a Paragraph
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdf
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17
 

CIS282 Midterm review

  • 2. Database Server  Operates as a separate “process”  Need to communicate with the server using a separate application  Connection required to transmit request and response  Management Studio and SQL Server are different programs
  • 3. Managing SQL Server  Management Studio gives access to most functions/operations  Query window provides method to write/execute T- SQL statements  “T” = transact  SQL Service Manager provides way to start/stop Server
  • 4. SQL Server Databases  Two files are maintained  Data file (.mdf)  Transaction Log file (.ldf)  Files can be spread over multiple machines  Always need a primary file group
  • 5. Database Contents  Tables  User tables hold data  System tables hold data about the database  Stored Procedures, User Defined Functions  Views  Indexes
  • 6. Default Databases  Master: Logins/User roles; system configuration; names/locations of databases; SQL Server startup  Tempdb: Lasts duration of SQL Server session; temporary holding space  Model: Sets characteristics of new databases  MSDB: Holds information about jobs SQL Server Agent runs
  • 7. Security  Windows Authentication: Windows network logins used  Mixed-mode: Windows OR SQL Server logins used  Login: To access server  User: To access a database  Network security trumps all….
  • 8. Roles  Server – administrative functions  Task based:  Backup  Create database  Roles are fixed  Database/Application – groups of users with common activities  Read/write all data  Read/write select data  Read data only
  • 9. Normalization  Process for reducing duplicate and redundant data  1st Normal Form: eliminate repeating groups  2nd Normal Form: each column in a table depends on the primary key  can’t get information with only part of the key  3rd Normal Form: A column cannot be dependent on another column that isn’t the primary key
  • 10. Relationships  Types  One-to-one  One-to-many  Many-to-many  Requires a primary key on the ‘one’ side, foreign key on the ‘many’ side  Referential Integrity defines how values work across tables
  • 11. Table Definition  Fields need a name and datatype  SQL Server datatypes are different from Access and procedural programming language datatypes  Fieldnames can include spaces – but poor practice  Identity – create unique number for each row
  • 12. Constraints  Allow Null – value not required to add record  Check Constraints – test field or row values  Default value – if no data is entered into a field  Unique – values must be different for each row
  • 13. Database Diagrams  Illustrate database design  Add, modify tables, indexes, relationships  Can control view, table details
  • 14. Indexes  Help to select and find records  Serve as a “cross-reference”  Can be based on one or more fields
  • 15. Good Index Characteristics  Low maintenance columns  Includes columns used frequently in Where or Order By clauses  Don’t have to go out to table for data  Help search for ranges of records
  • 16. Action Queries  Insert: insert into tablename(fieldlist) values(valuelist)  Update: update tablename set field1=value1, field2=value2  Delete: delete from tablename [where condition]
  • 17. Select Statement  Can use an alias for fields and/or tables  Select fields  From table  Join table On field=field  Inner – both tables have records with matching values  Outer – all records from one table and any matches found in second table
  • 18. Where  Conditions to determine records returned  Multiple conditions require And … Or  Can use where clause to implement join between tables  Sub-queries allow tables to be limited by values in a second table without using a join
  • 19. Views  Pre-defined select statement  Used like a virtual table SELECT * FROM v_CurrentEmployees
  • 20. View Performance  By default views run just as a query processed from command line  Adds second step to execution:  select from view  execute view itself  Can add an index to speed execution  Specific requirements when creating an index on a view