Database Connectivity Flashcards

Databases are used to store our applications data. The importance of good database design cannot be understated. A database that is well designed will make the development of an application much easier and more efficient. In this chapter, we will begin by looking at the concept of a database schema. Next, we will discuss the concepts of tables, attributes, and relationships. After that, we will examine the Structured Query Language. And finally, we will discuss the DataBoundControl class.

1
Q

What is a database schema?

A

A database schema is a data model that represents the structure of a database in terms of its tables, attributes and relationships.

When designing and coding a web application, it is importatnt to keep a correct and up-to-date database schema handy as it is esssential to the correct design and implimentation of the application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Table Summary

A
  • Tables are used to store something of interest to our application. (If we have a shop, we would ceate seperate tables to store “objects”. We could have a customer table, item table and order table.)
  • An attribute is a characteristic of the “objects” we store in our tables. (A customer will have a first name attribute, last name attribute.) Attribute correspond to columns in our tables.
  • New rows in our table correspond to a new instance of our “object”. If our customer table has 3 rows (excluding the headers row) then we have 3 seperate instances of the customer “object”.
  • Tables should be named using singular nouns, instead of plural, as a standard. (Customer table instead of customers)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a table?

A

A table is a two dimensional data structure that contains one or more rows and columns.

A table is used to store the of something of interest to the application.

Tables should be named with a singular noun or phrase as a standard. (Customer instead of customers)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an attribute? How can we identify one in a table?

A

An attribute is stores a characteristic of somethingof interest to our application.

Each column in our table will be an attribute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a database relationship? How is a relationship implimented?

A

A relationship is the logical association between two database tables.

Relationships are implimented via primary and foreign keys. These will be shared attributes between two tables. (A customer may have attributes FirstName, LastName and OrderNumber (for orders they place). The FirstName and LastName attributes will be specific to the customer object, however the OrderNumber will also be an attribute of the order object. Through the shared attribute the two tables are linked.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a primary key? What are the two rules when creating primary keys?

A

A primary key is the attribute (or combination of attributes) in a table that uniquely identifies each row in the table.

  1. A primary key value must be unique.
  2. A primary key value must not be null.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Structured Query Language (SQL) Summary

A
  • SQL is a fourth-generation (or imperative) programming language that retrieves and manages the data in a relational database.
  • SQL is by far the most widely used relational database language.

The statements of SQL are divided into four categories:

  1. Data Definition Language (DDL statements)
  2. Data Control Language (DCL statements)
  3. Data Query Language (DQL statements)
  4. Data Manipulation Language (DML statements)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly