Professional Documents
Culture Documents
Unit 3
Unit 3
Introduction
▪ Database has a data model that determines the manner in which data can be
stored,
database.
▪ Data are stored in a two-dimensional table, which contains columns or fields and
rows or records.
▪ Each column of a table represents an attribute or data value, and each row in a
table
▪ Attributes are the set of properties to describe the instances of the entity.
▪ The attributes of a student can be described in terms of student id, name, age,
grade
▪ A data type is the type of data value you want to store in the field.
▪ In the database, the data type best describes the fields in the table.
▪ All Database Management System(DBMS) provide data types from which to select
▪ In relational database, each table that has a key field (primary key) uniquely
▪ This key field can be used to create relationship and link one table of data to
another.
▪ Relational databases are the most popular databases have been widely used for
more
Examples of popular RDBMs include Microsoft Access, Oracle, Microsoft SQL Server,
manipulating a database.
SQL is a special-purpose query language meant for interacting with relational
I. Data Definition Language (DDL): DDL contains commands that allow you to
create or modify tables and establish relationship between tables in your database
structure.
II. Data Manipulation Language (DML): DML contains commands that are used to
III. Data Query Language (DQL): is used for querying or selecting all or subsets of
✓ CREATE TABLE,
✓ DROP TABLE
II. ALTER TABLE Command - Once a table is created, it can be modified using the
▪ Using the ALTER command, you can add column(s), drop column(s), and change
column definitions.
▪ Use the DROP TABLE command to delete the table already created.
▪ Remember that if you delete a table with record, you cannot get it back!
Access.
▪ A relationship in MS Access helps you combine data from two or more different
tables.
▪ all related tables have a common data item (key field) that enables information
✓ INSERT,
✓ UPDATE and
✓ DELETE.
II. UPDATE Command - The UPDATE command does not add new records to a
▪ DELETE command does not remove the table structure, rather it only deletes the
data
▪ Data Query Language (DQL) is a data query language for relational DBMSs.
▪ It provides a SELECT command for querying all or subset of records from one or
▪ The SELECT command provides options for filtering and getting more meaningful
▪ The level of flexibility that is given by SQL is one of the reasons it has succeeded as
a
▪ A SELECT command is used to write the SQL statement that contains a complete
✓ SELECT,
✓ FROM, and
✓ WHERE
SELECT SQL statement takes the general form as follows:
FROM table
[WHERE criterion];
▪ It can be used to filter the output that is returned by the FROM clause.
Review Questions
1. Which one of the following is generally used for performing tasks like creating the
A. Query
B. Relational Schema
2. Which one of the following provides the ability to insert tuples into, delete tuples
from,
A. Query
B. Relational Schema
A. CREATE B. DELETE
A. CREATE B. UPDATE
C. DELETE D. MERGE
6. Which one of the following commands is used to remove the existing row in a
table
A. DELETE B. UPDATE
7. Which language is used by most DBMS for helping its users access data?
C. ORDBMS D. OODBMS