0% found this document useful (0 votes)
478 views21 pages

Logical Database Design

Logical database design is the process of arranging attributes from business entities into database structures like tables. The goal is to create well-structured tables that properly reflect the business environment without redundancy. Data normalization decomposes attributes into subgroups in three normal forms to eliminate redundancy. SQL is used to define and manipulate data through commands like SELECT, INSERT, UPDATE, and DELETE. Data types specify the allowed values for table columns.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
478 views21 pages

Logical Database Design

Logical database design is the process of arranging attributes from business entities into database structures like tables. The goal is to create well-structured tables that properly reflect the business environment without redundancy. Data normalization decomposes attributes into subgroups in three normal forms to eliminate redundancy. SQL is used to define and manipulate data through commands like SELECT, INSERT, UPDATE, and DELETE. Data types specify the allowed values for table columns.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

LOGICAL DATABASE

DESIGN
Objectives
◦ Describe the concept of logical database design.
◦ Design relational databases by converting entity-relationship diagrams into relational tables.
◦ Describe the data normalization process.
◦ Perform the data normalization process.
◦ Learn basic SQL commands to build data structures.
◦ Learn basic SQL commands to manipulate data.
Logical database design
◦ is the process of deciding how to arrange the attributes of the entities in a
given business environment into database structures, such as the tables of
a relational database.
◦ The goal of logical database design is to create well structured tables that
properly reflect the company’s business environment.
◦ The tables will be able to store data about the company’s entities in a non-
redundant manner and foreign keys will be placed in the tables so that all
the relationships among the entities will be supported.
Data normalization
◦ a technique developed when the hierarchical and network approaches to database
management were the only ones available
◦ was the earliest formalized database design technique and at one time was the starting point
for logical database design.
◦ can also be used to design relational databases and, actually, is a better fit for relational
databases than it was for the hierarchical and network databases
◦ Today, with the popularity of the Entity-Relationship model and other such diagramming
tools and the ability to convert its diagrams to database structures, data normalization is used
more as a check on database structures produced from E-R diagrams than as a full-scale
database design technique.
◦ a methodology for organizing attributes into tables so that redundancy among the non-key
attributes is eliminated.
◦ the output of the data normalization process is a properly structured relational database
Two parts of data normalization process
(input required)
◦ list of all the attributes that must be incorporated into the database:
◦ that is, all of the attributes in all of the entities involved in the business environment under discussion plus all of the intersection
data attributes in all of the many-to-many relationships between these entities
◦ list of all of the defining associations among the attributes.
◦ Formally, these defining associations are known as functional dependencies.
Steps in the Data Normalization Process
◦ The data normalization process is known as a ‘‘decomposition
process.’’ Basically, we are going to line up all the attributes that will
be included in the relational database and start subdividing them into
groups that will eventually form the database’s tables. Thus, we are
going to ‘‘decompose’’ the original list of all of the attributes into
subgroups.
◦ Three main normal forms in order:
◦ First Normal Form
◦ Second Normal Form
◦ Third Normal Form
Three additional points to remember:
Here are three additional points to remember:
1. Once the attributes are arranged in third normal form (and if none of the
exception conditions are present), the group of tables that they comprise
is, in fact, a well-structured relational database with no data redundancy.
2. A group of tables is said to be in a particular normal form if every table in
the group is in that normal form.
3. The data normalization process is progressive. If a group of tables is in
second normal form it is also in first normal form. If they are in third
normal form they are also in second normal form
Unnormalized Data
First Normal Form
Second Normal Form
Third Normal Form
There are several important points to note about the third normal
form structure of Figure 7.33:
1. It is completely free of data redundancy.
2. All foreign keys appear where needed to logically tie together
related tables.
3. It is the same structure that would have been derived from a
properly drawn entity-relationship diagram of the same business
environment.
Structured Query Language (SQL)
◦ SQL (Structured Query Language) is a database computer language
designed for managing data in relational database management systems
(RDBMS).
Queries
◦ The most common operation in SQL is the query, which is performed with
the declarative SELECT statement. SELECT retrieves data from one or more
tables, or expressions. Standard SELECT statements have no persistent
effects on the database.

◦ Queries allow the user to describe desired data, leaving the database
management system (DBMS) responsible for planning, optimizing, and
performing the physical operations necessary to produce that result as it
chooses.
Queries
A query includes a list of columns to be included in the final result immediately following the SELECT keyword. An
asterisk ("*") can also be used to specify that the query should return all columns of the queried tables. SELECT is
the most complex statement in SQL, with optional keywords and clauses that include:
◦ The FROM clause which indicates the table(s) from which data is to be retrieved. The FROM clause can include
optional JOIN subclauses to specify the rules for joining tables.
◦ The WHERE clause includes a comparison predicate, which restricts the rows returned by the query. The WHERE
clause eliminates all rows from the result set for which the comparison predicate does not evaluate to True.
◦ The GROUP BY clause is used to project rows having common values into a smaller set of rows. GROUP BY is
often used in conjunction with SQL aggregation functions or to eliminate duplicate rows from a result set. The
WHERE clause is applied before the GROUP BY clause.
◦ The HAVING clause includes a predicate used to filter rows resulting from the GROUP BY clause. Because it acts
on the results of the GROUP BY clause, aggregation functions can be used in the HAVING clause predicate.
◦ The ORDER BY clause identifies which columns are used to sort the resulting data, and in which direction they
should be sorted (options are ascending or descending). Without an ORDER BY clause, the order of rows
returned by an SQL query is undefined.
Queries (Example)
Data Manipulation
◦ The Data Manipulation Language (DML) is the subset of SQL used to add, update and delete data
◦ The acronym CRUD refers to all of the major functions that need to be implemented in a relational
database application to consider it complete. Each letter in the acronym can be mapped to a standard
SQL statement:

Operation SQL
Create INSERT
Read (Retrieve) SELECT
Update UPDATE
Delete (Destroy) DELETE
Data Manipulation (Example)
Data Definition
The Data Definition Language (DDL) manages table and index structure. The most basic items of
DDL are the CREATE, ALTER, RENAME and DROP statements:
◦ CREATE creates an object (a table, for example) in the database.
◦ DROP deletes an object in the database, usually irretrievably.
◦ ALTER modifies the structure an existing object in various ways—for example, adding a column to an
existing table.
Data Types
Each column in an SQL table declares the type(s) that column may contain. ANSI SQL includes
the following data types.
◦ Character Strings
◦ CHARACTER(n) or CHAR(n) — fixed-width n-character string, padded with spaces as needed
◦ CHARACTER VARYING(n) or VARCHAR(n) — variable-width string with a maximum size of n
characters
◦ NATIONAL CHARACTER(n) or NCHAR(n) — fixed width string supporting an international
character set
◦ NATIONAL CHARACTER VARYING(n) or NVARCHAR(n) — variable-width NCHAR string
◦ Bit Strings
◦ BIT(n) — an array of n bits
◦ BIT VARYING(n) — an array of up to n bits
Data Types
◦ Numbers
◦ INTEGER and SMALLINT
◦ FLOAT, REAL and DOUBLE PRECISION
◦ NUMERIC(precision, scale) or DECIMAL(precision, scale)
◦ Date and Time
◦ DATE
◦ TIME
◦ TIMESTAMP
◦ INTERVAL
Microsoft Office Access
◦ Microsoft Office Access, previously known as Microsoft Access, is a relational database
management system from Microsoft that combines the relational Microsoft Jet Database Engine
with a graphical user interface and software development tools. It is a member of the Microsoft
Office suite of applications and is included in the Professional and higher versions for Windows.
Access stores data in its own format based on the Access Jet Database Engine.
◦ Microsoft Access is used by programmers and non-programmers to create their own simple
database solutions.
◦ Microsoft Access is a file server-based database. Unlike client-server relational database
management systems (RDBMS), e.g., Microsoft SQL Server, Microsoft Access does not
implement database triggers, stored procedures, or transaction logging. All database tables,
queries, forms, reports, macros, and modules are stored in the Access Jet database as a single
file. This makes Microsoft Access useful in small applications, teaching, etc. because it is easy to
move from one computer to another
◦ https://support.microsoft.com/en-us/office/access-sql-basic-concepts-vocabulary-and-syntax-
444d0303-cde1-424e-9a74-e8dc3e460671

Common questions

Powered by AI

The progression through normal forms in data normalization is a systematic approach to ensuring a well-structured database. The process starts with First Normal Form (1NF), progresses to Second Normal Form (2NF), and reaches Third Normal Form (3NF). A database in 3NF is completely free of data redundancy, with each normal form building on the previous one . This progression ensures that the tables are structured to eliminate duplicates and maintain data integrity .

SQL offers comprehensive functionalities for managing data, which makes it the preferred language for relational databases. It supports powerful querying capabilities with the SELECT statement, enabling complex data retrieval . SQL also allows data manipulation operations through its DML, providing CRUD capabilities (CREATE, READ, UPDATE, DELETE). Additionally, SQL's DDL handles schema and structure definitions, making it an all-encompassing language for database management .

Data normalization organizes attributes into tables such that redundancy among non-key attributes is eliminated . It is a decomposition process where attributes are subdivided into groups that form the basis of the tables, thereby ensuring that each piece of information is stored only once, reducing data redundancy .

Understanding functional dependencies is crucial in data normalization because they define how attributes relate to each other within a database structure. Functional dependencies are used to determine the composition of tables by identifying which attributes depend on others for their values. This ensures that tables are organized to minimize redundancy and maintain data integrity, which are central goals of normalization . Without knowing these dependencies, normalization cannot be properly applied .

Data normalization is often not the starting point in scenarios where entity-relationship models are used. With the popularity of entity-relationship diagramming tools, normalization is more often used as a check on database structures produced from these diagrams rather than a full-scale design technique . This approach leverages E-R diagrams to visually map out database structures before applying normalization to refine the design .

Foreign keys in logical database design are used to support relationships between entities. They are placed in tables to reference primary keys of other tables, thereby creating links between different tables in the database . This enforces referential integrity and ensures that the relational database can correctly represent the associations between different data entities .

Microsoft Office Access differs from client-server RDBMS like Microsoft SQL Server in that it is a file server-based database system, meaning all database tables, queries, and other objects are stored in a single file . It lacks features such as triggers, stored procedures, and transaction logging, which are common in client-server systems. This makes Access more suited for smaller applications and personal use where ease of transport and simplicity are valued .

A SQL SELECT statement primarily consists of SELECT, FROM, WHERE, GROUP BY, HAVING, and ORDER BY clauses. The SELECT clause specifies the columns to be retrieved, while the FROM clause indicates the table(s) from which data is sourced . The WHERE clause filters records based on defined criteria, and GROUP BY groups rows with common values for aggregation purposes . The HAVING clause further filters grouped data, and ORDER BY sorts the results . Together, these components allow complex data retrieval operations .

Logical database design is the process of deciding how to arrange the attributes of entities in a business environment into database structures, such as the tables of a relational database . The primary goals are to create well-structured tables that reflect the company's business environment, store data about the company's entities without redundancy, and support all relationships among the entities through the proper placement of foreign keys .

DDL and DML are subsets of SQL used for different purposes in database management. DDL focuses on defining and altering database structures using statements like CREATE, ALTER, and DROP . It manages the schema of the database. In contrast, DML deals with data manipulation within these structures, using commands like SELECT, INSERT, UPDATE, and DELETE to retrieve or modify data . Together, they manage both the structure and content of a database .

You might also like