Unit 3 – Database Management System
Session 1: Concept of Database Management System
Assessment – Fill in the blanks
- A database is an organized collection of data.
- A DBMS is a software package that can be used for creating and managing databases.
- A RDBMS is a database management system that is based on the relational model.
- Three popular DBMS software are Oracle, MY SQL, & MS Access.
- A Primary key is a unique value that identifies a row in a table.
- Composite Key is a combination of multiple columns.
Assessment Answer Questions
Question 1: What does DBMS stands for?
Answer: Data Base Management System
Question 2: What does RDBMS stands for?
Relational Data Base Management System
Question 3: How is data organized in a RDBMS?
Data in a Relational Database Management System (RDBMS) is organized using a structured approach based on tables, rows, and columns.
- Tables: In an RDBMS, data is organized into tables, also known as relations. Each table represents a specific entity, such as customers, products, employees, or orders.
- Rows (Tuples): Each row in a table represents a single data record or entity instance. It is often referred to as a tuple.
- Columns (Attributes): Columns are the individual data fields within a table, representing specific attributes or properties of the data records.
Question 4: State the relationship and difference between a primary and foreign key?
- Primary Key: The primary key uniquely identifies each row in the table. Each table typically has one or more columns designated as the primary key. It ensures data integrity and allows for efficient data retrieval and relationships between tables.
- For example, in a “Customers” table, the “CustomerID” column is often used as the primary key.
- Foreign Key: A foreign key is a column in one table that references the primary key of another table, creating a link between the two tables.
Session 2: Creating and using Tables
Assessment – Fill in the blanks
- A table is a set of data elements that is organized using a model of vertical and horizontal __.
- A _ is a set of data values of a particular type, one for each row of the table.
- A _ represents a single, data item in a table.
- _ are used to identify which type of data we are going to store in the database.
- There are __ ways to create a table.
- Field properties can be set in both the and _ .
Assessment Answer Questions
Question 1: In how many ways tables can be created in Base?
In LibreOffice Base, which is a free and open-source relational database management system (RDBMS), tables can be created in several ways:
- Using the Table Design View
- Using the Wizard
- Importing from Other Sources
- Copying an Existing Table
- Using SQL Commands
- Creating Linked Tables
Question 2: Why are data types used in DBMS /RDBMS?
Data types in DBMS/RDBMS are used to ensure data accuracy, storage efficiency, and effective data handling. They define the format and constraints for data stored in database tables, helping maintain data integrity by preventing incompatible data from being entered. Data types also optimize storage space, support efficient search and retrieval operations, enable sorting and indexing, and facilitate data validation. They play a critical role in query optimization and assist in data conversions and constraints, making them an essential component of database design and management.
Question 3: List datatypes available in Numeric Datatype.
Numeric data types in a typical relational database system (RDBMS) can include various data types to represent numeric values with different precision and scale.
Numeric Data Type | Description |
INTEGER (INT) | This data type represents whole numbers without decimal places. It typically uses 4 bytes of storage and can store a range of values, such as -2,147,483,648 to 2,147,483,647 in a signed integer. |
SMALLINT | Similar to INTEGER but with a smaller range. It usually uses 2 bytes of storage and can store values within a smaller range, such as -32,768 to 32,767 in a signed smallint. |
BIGINT | This data type is used for very large integers. It often uses 8 bytes of storage and can store extremely large values, such as -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 in a signed bigint. |
DECIMAL (also known as NUMERIC) | This data type is used for fixed-point or exact decimal numbers. It allows you to specify the precision (total number of digits) and scale (number of decimal places). For example, DECIMAL(10, 2) can store numbers like 12345.67, where 10 is the precision and 2 is the scale. |
FLOAT | This data type is used for approximate numeric values with floating-point precision. It can store numbers with decimal places and is suitable for scientific calculations. It uses 4 bytes (single-precision) or 8 bytes (double-precision) of storage. |
REAL | Similar to FLOAT but typically uses 4 bytes for single-precision floating-point numbers. |
DOUBLE | Similar to FLOAT but typically uses 8 bytes for double-precision floating-point numbers. |
NUMERIC | This data type is often used interchangeably with DECIMAL and is used for exact decimal numbers. Like DECIMAL, it allows you to specify precision and scale. |
BOOLEAN (BOOL) | This data type represents Boolean values, typically true or false. It uses a single bit for storage. |
Question 4: List datatypes available in Alphanumeric Datatype?
Alphanumeric data types, sometimes referred to as character data types, are used to store text-based data in a relational database system (RDBMS). These data types allow you to store letters, numbers, and symbols.
Alphanumeric Data Type | Description |
CHAR (Character) | CHAR is used to store fixed-length character strings. You specify the maximum length when defining the column. For example, CHAR(10) can store a 10-character string. It pads shorter strings with spaces. |
VARCHAR (Variable Character) | VARCHAR is used to store variable-length character strings. It only uses as much space as needed for the actual data, which can be more efficient than CHAR for shorter strings. For example, VARCHAR(255) can store strings of up to 255 characters. |
TEXT | TEXT is used to store large amounts of character data, typically for longer text fields like descriptions, comments, or documents. It’s a variable-length data type capable of storing a significant amount of text. |
Question 5: Define the structure of a table.
The structure of a table in a database defines how the table is organized and what kind of data it can hold. It includes the components like Table Name, Rows (Records), Columns (Fields), Data Types, Foreign Key, Constraints (example: NOT NULL) etc.
Structure – Table Name: Customers
Field Name (Column) | Data Type |
CustomerID | Primary Key, Integer |
FirstName | Text |
LastName | Text |
Text | |
Phone | Text |
Birthdate | Date |
Address | Text |
Question 6: Differentiate between Tuples and Attributes of a table.
- Tuple (Row): Each tuple in a table represents a single data record or entity instance. It is often referred to as a tuple. For example, in a “Customers” table, each row might represent information about a specific customer, including their name, address, contact details, etc.
- Attribute (Column): Attributes are the individual data fields within a table, representing specific column or properties of the data records. For instance, in a “Customers” table, columns may include “CustomerID,” “FirstName,” “LastName,” “Email,” and so on. Each column is assigned a data type that defines the kind of data it can hold, such as text, numbers, dates, etc.
Question 7: Name different Binary data types.
Binary data types are used for storing data in binary formats. Binary data types in a database can be using for storing photos, music files etc. In general, files of any format can be stored using the binary data type. The different types of binary data types available are listed below:
Binary Data Type | Description |
LONGVARBINARY | Stores any array of bytes (images, sound etc.). No validation required. |
BINARY | Stores any array of bytes (fix). No validation required. |
VARBINARY | Stores any array of bytes. No validation required. |
Question 8: Name different Date/Time data types.
Date time data types are used for describing date and time values for the field used in the table of database. These are used for storing information such as date of birth, date of admission, date of product sale etc.
The different types of data time data types available are listed below:
DateTime Data Type | Description |
DATE | Stores day, month and year information |
TIME | Stores hour, minute and second information |
TIMESTAMP | Stores data and time information |
Session 3: Performing Operations on Tables
Assessment – Fill in the blanks
- The types of languages used for creating and manipulating the data in the Database are __ & __.
- A ________ is a standard for commands that define the different structures in a database.
- A __ is a language that enables users to access and manipulate data in a database.
- A _ is a part of DML involving information retrieval only.
- A popular data manipulation language is _____.
- __ are the basic building blocks of a database.
- There are __ types of Relationships in a table.
Assessment Answer Questions
Question: What is the file extension for databases created using OpenOffice.Org Base?
Question: List any three file formats that can be managed using OpenOffice.Org Base?
Question: How many types of relationships can be created in Base? Explain each of the them.
Question: What do you mean by Sorting? In how many ways it can be done?
Question: Explain Referential Integrity with the help of an example.
Session 4: Retrieving Data using Queries
Assessment – Fill in the blanks
- A _ helps the user to systematically store information in the database.
- A __ enables users to view, enter, and change data directly in database objects such as tables.
- _ statement retrieves zero or more rows from one or more database tables or database views.
- By default, data is arranged in _ order using ORDER BY clause.
- __ statement is used for modifying records in a database.
- __ statement is used to remove one or more records in a Database.
Assessment Answer Questions
Question: Name DDL commands.
Question: Name DML commands.
Question: What is the purpose of using queries?
Question: Which clause of Select statement helps to display specific data?
Question: Differentiate between Where and Orderby clause of SQL statements.
Question: State the purpose of Update Command with the help of an example.
Session 5: Working with Forms and Reports
Assessment – Fill in the blanks
- To create a form you need to select _ option available under Database section.
- A __ is helps to collect specific information from the pool of data in the database.
- __ is used to display the display the summary of data.
- _ are the interfaces with which the user interacts.
- Data from multiple tables can be stored in _.
Assessment Answer Questions
Question: Why there is a need to create Forms?
Question: What is the purpose of creating Reports?
Question: What are the prerequisites to create a Form and Reports?
Question: Differentiate between Forms and Reports.
Question: Can a form displays data from queries?
Question: In how many ways Forms and Reports can be created in a database?