Professional Documents
Culture Documents
C++
Relational and Object Databases
• CAD systems utilize relational databases
to store geometric, graphical, and other
data that defines a CAD model. A model
database is stored in the model or part file.
• A relational database is conceptually a
set or collection of tables. A table is
considered a relation. A database with
four tables is considered a database with
four relations. Each table stores data
about a given entity. The data in a table is
organized or stored as attributes in rows.
Each row in a table is known as a record.
• For example, a database of a bank may
have a table of customers (the entity).
Each customer has a row (record) in the
table. The record could hold the customer
name and account number (the data
attributes). Entities can be thought of as
objects with attributes.
Relationships between tables can
be of three types
• one-to-one, one-to-many, and many-to-one.
• In a one-to-one relationship, there is only one
record in the second table for each record in the
first table. In the one-to-many relationship,
multiple records exist in the second table for
each record in the first table. The one-to-many
relationship is sometimes known as a parent-
child relationship. The many-to-one relationship
is opposite to the one-to-many relationship; for
multiple records in the first table, only one record
exists in the second table.
• SQL (Structured Query Language) is the language
commonly used to query and update relational
databases.
• SQL can be used to retrieve, sort, and filter specific data
of a database. SQL also allows users to define data in
databases and later manipulate it. SQL was developed
by IBM.
• SQL uses set logic to query databases. It is an easy
language to learn; it has an English-like syntax.
• It requires few keywords and clauses to perform
powerful data retrieval from the database.
• Report formatting is also simple using SQL. Sample
statements include CREATE DATABASE, CREATE
TABLE, SELECT, ALTER, INSERT, DELETE, and
UPDATE.
• The query SELECT FirstName, LastName
FROM CustomerName; returns the two columns
labeled FirstName and LastName in the table
CustomerName as the query result. Note that
the SELECT statement must end with a
semicolon, as all SQL statements end with a
semicolon.
• We must create a database before we can use
it. We need a database schema that defines the
types of variables used in the database records
in each table. We use this schema to create
each table of the database. The following
screenshot (of Microsoft Access) shows the
definition of a schema for a bank database table.
CAD systems utilize various types of data structures and
databases to store CAD menu and texts and their related
data. Many systems use relational databases to store
model data. They store the boundary representation of
the model, that is, the faces, edges, and vertices of the
model.
Figure 2.7
Parametric Design and Objects