G 10 DBMS NOTES
G 10 DBMS NOTES
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.
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.
UNSOLVED QUESTION
I. Give an example of many to many relationships.
II. What is the use of table in relationship?
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.
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.
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?