Database Fundamentals/Tables and Data Types

From Wikiversity
Jump to navigation Jump to search

This lesson introduces tables and data types.

Objectives and Skills[edit | edit source]

Objectives and skills for the tables and data types portion of Microsoft Exam 98-364 Database Fundamentals include:[1]

  • Create database objects
    • Understand tables and how to create them
      • Purpose of tables; create tables in a database by using proper ANSI SQL syntax
    • Choose data types
      • Understand what data types are, why they are important, and how they affect storage requirements

Readings[edit | edit source]

  1. Wikipedia: Table (database)
  2. Wikipedia: Field (computer science)
  3. Wikipedia: Data type
  4. Wikipedia: Data definition language

Multimedia[edit | edit source]

  1. Microsoft Virtual Academy: Creating Databases and Database Objects
  2. YouTube: Database Objects

Activities[edit | edit source]

  1. Create a new sample database.
  2. Create a new database:
  3. Create tables in sample database:
    • Watch YouTube: SQL Server 2014 How to Create Tables.
    • Read Microsoft: Create Tables Using SQL Server Management Studio (Database Engine).
    • Read SQL General Data Types.
    • Create three tables using SQL Server Management Studio named Student, Course and Instructor.
    • Add three fields (columns) into each table with applicable data types of your choice.
      • For example: Course table could include the CourseID, Description, CreditHours fields. CourseID is the primary key.
      • Student table could include the StudentID, StudentFirstName, StudentLastName fields. StudentID is the primary key.
      • Instructor table could include the InstructorID, InstructorFirstName, InstructorLastName, Department. InstructorID is the primary key.
    • For each table, insert three or five records. In the Student table, insert a student record with your first name and last name.
    • Practice displaying and examining the database tables, columns and data.

Lesson Summary[edit | edit source]

  • Each column in an SQL table declares the data type(s) that column may contain.[2]
  • A table is a collection of related data held in a structured format within a database. It consists of fields (columns), and rows.[3]

Key Terms[edit | edit source]

data type

See Also[edit | edit source]

References[edit | edit source]

Nuvola apps edu miscellaneous.svg Type classification: this is a lesson resource.