0% found this document useful (0 votes)
11 views

G 10 DBMS NOTES

The document provides an overview of Database Management Systems (DBMS), detailing types of databases, advantages, key features, and essential terms like primary and foreign keys. It explains the creation and management of relational databases using software like OpenOffice and SQL, highlighting the importance of data integrity and relationships between tables. Additionally, it covers operations on tables, data types, and the use of queries to retrieve and manipulate data.
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)
11 views

G 10 DBMS NOTES

The document provides an overview of Database Management Systems (DBMS), detailing types of databases, advantages, key features, and essential terms like primary and foreign keys. It explains the creation and management of relational databases using software like OpenOffice and SQL, highlighting the importance of data integrity and relationships between tables. Additionally, it covers operations on tables, data types, and the use of queries to retrieve and manipulate data.
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
You are on page 1/ 10

UNIT III DATABASE MANAGEMENT SYSTEM

CHAPTER 10 - CONCEPT OF DATABASE MANAGEMENT SYSTEM


A database is an organized collection of data. It is considered as a container of information.
In the manual system, you would maintain several files with different bits of information
while in the computerized system you would use database programs such as Microsoft
Access, OpenOffice.org Base, and MySQL, to organize the data as per your business need.
Database Management System:
A database management system is a software package with computer programs that
controls the creation, maintenance, and use of a database. for example Oracle, IBM DB2,
Microsoft SQL Server, Microsoft Access, PostgreSQL, MySQL, FoxPro, and SQLite.
Data can be organized into two types:
1. Flat File : Data is stored in a single table. Usually suitable for less amount of data.
2. Relational : Data is stored in multiple tables and the tables are linked using a
common field. Relational is suitable for medium to large amount of data.
Database Servers :
Database servers are dedicated computers that hold the actual databases and run only the
DBMS and related software.
Advantages of Database :
1) Reduces Data Redundancy : Database reduces data redundancy (duplication of data)
2) Sharing of Data : In a database, the users of the database can share the data among
themselves.
3) Data Integrity : Data integrity means that the data is accurate and consistent in the
database.
4) Data Security : Database provides data security as only authorized users are allowed to
access the database and their identity are authenticated by using a username and password.
5) Privacy : The privacy rule in a database states that only the authorized users can access a
database according to its privacy constraints.
6) Backup and Recovery : Database Management System automatically takes care of backup
and recovery.
Some key features of a database:
1) A database can have one or many tables.
2) Each table in a database contains information about one type of item.
3) Every table has a key field which ensures that there are 100% unique values throughout
the database.
Important Terms :
1) Primary Key : A primary key is a unique value that identifies a row in a table. It helps the
database to search for a record.
2) Composite Primary Key : When primary key constraint is applied on one or more
columns then it is known as Composite Primary Key.
3) Foreign key : The foreign key identifies a column or set of columns in one (referencing)
table that refers to a column or set of columns in another (referenced) table.
4) Candidate Key:- A table can have one or more fields that may uniquely identify the
records. Such fields are called candidate key.
5) Super key:- A super key refers to the set of all those keys that help us uniquely identify all
the rows present in a table. It means that all of these columns present in a table that can
identify the columns of that table uniquely act as the super keys.
6) Alternate key:- As we have stated above, any table can consist of multiple choices for the
primary key. But, it can only choose one. Thus, all those keys that did not become a primary
key are known as alternate keys.

ASSESSMENT
Fill in the blanks:
1) A __ is an organized collection of data.
2) A ____ is a software package that can be used for creating and managing databases.
3) A __________ is a database management system that is based on the relational model.
4.Three popular DBMS software are _________ , _____________________, &
_________________________
5) A _____________ is a unique value that identifies a row in a table.
6) Composite Key is a combination of _________________ columns.
Short Answer Questions
Q1. What does DBMS stands for?
Q2. What does RDBMS stands for?
Q3. How is data organized in a RDBMS?
Q4. State the relationship and difference between a primary and foreign key?
Q5. Difference between DBMS and RDMS.

CHAPTER 11 : CREATE AND USING TABLES

RELATIONAL DATABASE MANAGEMENT SYSTEM(RDBMS)


A relational database management system (RDBMS) is a program used to create, update,
and manage relational databases. Some of the most well-known RDBMSs include MySQL,
PostgreSQL, MariaDB, Microsoft SQL Server, and Oracle Database. Data in a relational
database management system (RDBMS) is organized in the form of tables.
DATABASE OBJECTS :
1) Table : A table is a set of data elements (values) that is organized using a model of vertical
columns and horizontal rows.
2) Columns or Fields or Attributes: A column is a set of data values of a particular simple
type, one for each row of the table.
3) Rows or Records or Tuples : A row also called a Record or Tuple represents a single data
item in a table. Every row in the table has the same structure.
Creating Database Using OpenOffice :
1) Open the OpenOffice Base Application by Clicking on Start>Programs>OpenOffice.org
4>OpenOffice.org Base.
2) Create a new database by selecting the option Create a new database
3) Database wizard appear. Click Finish. The Save As dialog box appears.
4) Specify a name for the database in the File name: field and click Save.
Create Tables :
Tables are the basic building blocks of a database. You store the data in the database in the
form of tables.
There are different ways to create a table:
a) Use Wizard To Create Table: The following are the steps to create a table:
1) Click on Tables > Use Wizard to Create Table

2) Click the Select Fields > Choose Category > Select the table > Click on Next Button.
3) Select the fields as per the requirements. Click on Next button
4) Set the data types and properties of the selected fields. Click on Next Button
5) Set the Primary Key and Click on Next Button
6) Window to rename the table will open. A user can either go ahead with the same table
name or can change it.
7) Click on Finish to insert the data in the table.
b) Creating table using Design View
1) Click on Create Table in Design View.
2) Specify the field name and data type of the field.
3) Save the table by clicking on File > Save
4) Specify the table name. The default name is Table1. Click OK.
5) An alert appears, if there is no primary key in the table.
6) Click yes and set the primary key and finally save the table.
Data Types :
Datatypes are used to identify which type of data (value) we are going to store in the
database. Data types in OpenOffice base are broadly classified into five categories listed
below.
1. Numeric Types
2. Alphanumeric Types
3. Binary Types
4. Date time
5. Other Variable types
Numeric Types :
Numeric data types in a database can be used for storing information such as mobile
number, roll number, door number etc. The different types of numeric data types available
are listed here.
Alphanumeric Types :
This data type is used to store information which has alphabets as well as numbers for
example address, book summary field etc. The different types of Alphanumeric
Types available are listed here.

Binary 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.
DATE TIME :
Date time data types in a database can be used for storing information such as date of birth,
date of admission, date of product sale, etc.

Fill in the blanks:


1) A table is a set of data elements that is organized using a model of vertical and horizontal
__________________.
2) A _______________ is a set of data values of a particular type, one for each row of the table.
3) A____________________ _ represents a single, data item in a table.
4) _______________________ are used to identify which type of data we are going to store in the
database.
5) There are __________________ ways to create a table.
6) Field properties can be set in both the _________________ and _______________ .

Short Answer Questions


Q1. In how many ways tables can be created in Base?
Q2. Why are data types used in DBMS /RDBMS?
Q3. List datatypes available in Numeric Datatype?
Q4. List datatypes available in Alphanumeric Datatype?
Q5. Define the structure of a table.
Q6. Differentiate between Tuples and Attributes of a table.
Q7. Name different Binary data types.
Q8. What is difference between cardinality and degree in dbms.

CHAPTER 12: PERFORMING OPERATIONS ON


TABLE
In OpenOffice Base, data is stored in tables which can be inserted, modified and removed
using appropriate options.
Inserting Data In The Table : To insert the data in the table, follow the steps:
1) Select the table > Double click on it.
2) The table will open in Datasheet View.
3) Insert the required number of records in Datasheet View.
Editing Records In The Table : To edit the data in the table, follow the steps:
1) Select the table > Double click on it.
2) The table will open in Datasheet View.
3) Edit the required record in Datasheet View.
Deleting Records From The Table : To remove the data from the table, follow
the steps:
1) Select the table > Double click on it.
2) The table will open in Datasheet View.
3) Select the data > right click on selected data > select the Delete option
Field Properties :
To set the field properties: Select the table > Right click > Select the option Edit > the table
will open in Design View.
In design view there are different properties of fields according to the data type set for each
field.
The properties of numeric type data is given below :
1) AutoValue – if set to yes then field will get the auto numeric values.
2) AutoValue – if set to yes then field will get the auto numeric values.
3) Length – By default length of the field is 10 but the size of the field can be set to
maximum length.
4) Default Value – A default value can be set for a field if user don’t provide any value while
entering the values in the table.
5) Format – This property helps to set the format of the data entered in the field such as 91-
222-333.
The properties of character type data is shown below :
1) Entry Required – if set to yes then it will be must to insert the value in the field.
2) Length – By default length of the field is 10 but the size of the field can be set to
maximum length.
3) Default Value – A default value can be set for a field if user don’t provide any value while
entering the values in the table.
4) Format – This property helps to set the format of the data entered in the field such as 91-
222-333.
Sorting Data :
Sorting means to arrange the data in either ascending order of descending order.
Referential Integrity :
Referential integrity is used to maintain accuracy and consistency of data in a relationship. In
Base, data can be linked between two or more tables with the help of primary key and
foreign key
Referential integrity helps to avoid:
1) Adding records to a related table if there is no associated record available in the primary
key table.
2) Changing values in a primary if any dependent records are present in associated table(s).
3) Deleting records from a primary key table if there are any matching related records
available in associated table(s).
Relationship:-
A relationship refers to an association or connection between two or more tables. A
relationship between tables helps to:
1. Save time as there is no need to enter the same data in separate tables.
2. Reduce data-entry errors.
3. Summarize data from related tables.
You can create a relationship between any two tables by selecting Relationships option from
the Tools menu.
Types of Relationship between tables
There are three types of relationships which can be created in tables:
1) ONE to ONE Relationship: In this relationship, both the tables must have primary key
columns. A record in a table can have only one matching record in another table, and vice
versa
2) One to Many Relationship: In this relationship, one of the table must have primary key
column. In this a record of a table A is associated with several matching records of table B.
3) Many to Many Relationships: In this relationship, no table has the primary key column.
In this many records are associated with many records of another table, and vice versa.

Remove the Relationships


The relationships applied on the tables can be removed also with the help of Delete option.
Right Click on the relationship thread and select Delete option.

Advantage of creating relationship:-


Creating relationships in a DBMS (Database Management System) offers several advantages,
including: reduced data redundancy, improved data integrity, easier data retrieval by
allowing access to related data from multiple tables simultaneously, better data
organization, and the ability to enforce data consistency through referential integrity.

UNSOLVED QUESTION
I. Give an example of many to many relationships.
II. What is the use of table in relationship?

CHAPTER 13 : RETRIEVE DATA USING QUERY


QUERY:-A query is to collect specific information from the pool of data. A query helps us
join information from different tables and filter that information
OR
Queries are commands that are used to define the data structure and also to manipulate the
data in the database.

CREATING A QUERY:- There are following ways to create a query.


i. Using Wizard:-
a. Choose query in database objects pane
b. Query wizard dialog box appears
c. Select the required fields and click on “>” button.
d. You will move to the next screen.
e. Set sorting order for selected fields.
f. The detailed query option is selected by default.
g. Click on next , next and finish

ii. Using Design View:-


a. Choose query in database objects pane
b. Select the create query in design view option in the tasks section.
c. The query design window appears with add table or query dialog box
d. Choose the table and click on add button
e. Now click on Close add table or query dialog box.
iii. Using SQL View:-
a. Select the tools menu and choose SQL.
b. The Execute SQL statement window opens.
c. Type the CREATE TABLE command in the command to execute section.
d. Click on the execute button and your query will be executed.

Wild cards:- Wildcards are special characters that are used as substitutes for one or more
characters in a string. Example:- %*, -?, [ ], ^, -

Function in query:- It provides various built in functions to perform calculations on data. All
the function are listed in the function row of the design grid pane. Example:- AVG, COUNT,
MAX, MIN , SUM GROUP BY.

CREATE TABLE WITH PRIMARY KEY:-


CREATE TABLE CLIENT(CLIENT_ID INTEGER NO NULL, FIRST_NAME VARHAR (20),
MOBILE_NUMBER (20), PRIMARY KEY(CLIENT_ID));
There are two types of languages:-
1. DDL (Data Definition Language)
2. DML (Data Manipulation Language)
Common DDL Statements are:-
1. Create :- Used to create database or tables.
2. Alter :- Used to modify structure of table.
3. Drop :- Used to delete database objects.
Common DML Statements are:-
1. SELECT :- Used to retrieves information from the database.
2. INSERT :- Used to insert new record into the database.
3. DELETE :- Used for deletion of information in the database.
4. UPDATE :- Used for modification of information in the database

Select Statement :
A SELECT statement retrieves zero or more rows from one or more tables. SELECT is the
most commonly used Data Manipulation Language(DML) command. To retrieve all the
columns in a table the syntax is: SELECT * FROM <Table Name>;
For example, if you want to display all the data from table emp (short form of employee), the
command is
Select * from emp;
The SELECT statement has many optional clauses:
1. WHERE specifies which rows to retrieve.
2. ORDER BY specifies an order in which to return the rows.
for example : Select * from emp where name = “Ravi”;
The above query will show result of a particular employee named “Ravi”.
Select * from emp order by Salary;
The above query will show all the records of table emp according to ascending order of
column Salary.
Performing calculations :
In Base, simple calculations can be done on the data using arithmetic operators. Example:
1) To display the salary of all the employees after incrementing by 1000 then the following
SQL command will be executed in Base. (Fields of table Employee are EmployeeID,
FirstName, Salary)
Select “EmployeeID”, “FirstName”, “Salary” +1000 from “Employee”;
2) To display the salary of all the employees after decreasing by 10000 then the SQL
command will be:
Select “EmployeeID”, “FirstName”, “Salary” – 10000 from “Employee”;
3) To display the salary of all the employees after incrementing it as twice the amount of
present salary, then the SQL command will be .
Select “EmployeeID”, “FirstName”, “Salary” * 2 from “Employee”
Update Command :
Update statement is used for modifying records in a database. The general syntax of the
update statement is as follows:
UPDATE <table name> SET <Column name > = value [WHERE <Condition>];
for example :
1) To increase(update) the salary of employee “Ravi” by Rs 2000 (in table Employee)then the
SQL command will be:
Update Employee set Salary = Salary + 2000 Where FirstName = “Ravi”;
Delete command:-It is used to delete the existing record from a table.
Syntax:- DELETE FROM student where roll_no=104;
Drop command:- It is used to delete the existing table from a database.
Syntax:- DROP TABLE student;
Alter table command:-it is used to add, delete, and modify the column in an existing table.
Syntax:- ALTER TABLE student
ADD subject_name varchar(30);
Syntax:- ALTER TABLE student
MODIFY subject_name varchar(40);
Syntax:- ALTER TABLE student
MODIFY subject_name SUBNAME varchar(40);

UNSOLVED QUESTION
a. What is QUERY?
b. What is SQL?
c. Differentiate between DDL and DML command.

CHAPTER 14: WORKING WITH FORMS AND REPORTS


FORM : A form provides the user a systematic way of storing information into the database.
It is an interface in a user specified layout that lets users to view, enter, and change data
directly in database objects such as tables.
Creating Form Using Wizard : Steps To Create Form Using Wizard are :
1) Click Use Wizard to Create Form… option under Tasks group. The Form Wizard dialog box
appears.
2) Select selective fields to be sent onto the form by selecting the field name and clicking
>button and click Next.
3) Select the option Add Subform if you need to insert the contents in the table in a separate
form and click Next.
4) Arrange selected fields in a form and click Next.
5) Select the data entry mode and click Next.
6) Specify the styles to be used in the form and click Next.
7) Specify the name of the form. Click Finish.
REPORT : A report helps to display the data in a summarized manner. It is used to generate
the overall work outcome in a clear format.
Creating Reports using wizard : Steps To Create Report Using Wizard are :
1) Click on Use Wizard to Create Report… option available under Tasks.
2) Select all the table fields by selecting the >> button.
3) Redefine the label of the fields in the reports or else you can set the default name and
click Next.
4) Define grouping for the fields of the table if required and click Next
5) Sort the field in the report by selecting the appropriate field name and sorting method(if
required) and click Next.
6) Select the layout of the report and click Next.
7) Define a name for the report and click Finish.

ADDING A NEW RECORD:- Click on new record button on the form navigation toolbar.
Enter the required information in blank field. Click on save.

Assessment
Fill in the blanks
1) To create a form you need to select ____________ option available under Database section.
2) A _______________ is helps to collect specific information from the pool of data in the
database.
3) ____________ is used to display the display the summary of data.
4) _____________ are the interfaces with which the user interacts.
5) Data from multiple tables can be stored in ____________________.
Short Answer Questions:
Q1. Why there is a need to create Forms?
Q2. What is the purpose of creating Reports?
Q3. What are the prerequisites to create a Form and Reports?
Q4. Differentiate between Forms and Reports.
Q5. Can a form displays data from queries?
Q6. In how many ways Forms and Reports can be created in a database?

You might also like