Database Fundamentals/Tables and Data Types
Appearance
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
- Understand tables and how to create them
Readings
[edit | edit source]- Wikipedia: Table (database)
- Wikipedia: Field (computer science)
- Wikipedia: Data type
- Wikipedia: Data definition language
Multimedia
[edit | edit source]Activities
[edit | edit source]- Create a new sample database.
- Create a new database:
- Watch YouTube: How to Create MS SQL Database Using SQL Server Management Studio.
- Read [1] Microsoft: SQL Server Create a Database].
- Create a new sample database called College using SQL Server Management Studio.
- 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 W3CSchools.com: 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
- table