Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Class X: Unit-3 Relational Database Management Systems (Basic)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Class X

UNIT-3 RELATIONAL DATABASE MANAGEMENT SYSTEMS (BASIC)


SESSION 1: APPRECIATE CONCEPT OF DATABASE MANAGEMENT SYSTEM
Ques: Define a Database.
Ans: A database is an organized collection of data. You can visualize it as a container of information. The
database concept has evolved since the 1960s to ease increasing difficulties in designing, building, and
maintaining complex information systems (typically with many concurrent end-users, and with a large amount
of diverse data).
Ques: Define DBMS.
Ans: A database management system is a software package with computer programs that controls the creation,
maintenance, and use of a database. It allows organizations to conveniently develop databases for various
applications. A DBMS allows different user application programs to concurrently access the same database.
Well known DBMSs include Oracle, IBM DB2, Microsoft SQL Server, Microsoft Access, PostgreSQL, MySQL,
FoxPro, and SQLite.
Ques: How data can be organized in database?
Ans: Data can be organized into two types:
• Flat File: Data is stored in a single table. Usually suitable for less amount of data.
• 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
Ques: Define Database servers.
Ans: Database servers are dedicated computers that hold the actual databases and run only the DBMS and
related software. Typically databases available on the database servers are accessed through command line or
graphic user interface tools referred to as Frontends; database servers are referred to as Back-ends. Such type
of data access is referred to as a client-server model.
Ques: Write some advantages of Database.
Ans: Reduces Data Redundancy
This is prevented in a database as there is a single database and any change in it is reflected immediately.
Because of this, there is no chance of encountering duplicate data.
Sharing of Data
In a database, the users of the database can share the data among themselves. There are various levels of
authorization to access the data, and consequently the data can only be shared based with the authorized
users
Data Integrity
Data integrity means that the data is accurate and consistent in the database. Data Integrity is very important
as there are multiple databases in a DBMS.
Data Security
Data Security is an important concept in a database. Only authorized users should be allowed to access the
database and their identity should be authenticated using a username and password.
Privacy
The privacy rule in a database states that only the authorized users can access a database according to its
privacy constraints
Backup and Recovery
Database Management System automatically takes care of backup and recovery. The users don't need to
backup data periodically because this is taken care of by the DBMS.
Data Consistency
Database Management System automatically takes care of backup and recovery. The users don't need to
backup data periodically because this is taken care of by the DBMS.
Ques: Write some key features of Database.
Ans: There are 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. So, a database is a container that holds
tables and other objects and manages how they can be used.
3. When creating a database an important feature is record uniqueness in every table.
Uniqueness helps to avoid accidental duplication of records caused by user or computer error. This can be
achieved by using some number or value that uniquely identifies a record. Therefore, every table has a key
field which ensures that there are 100% unique values throughout the database.
4. Every database table should have one or more fields designated as key. You can assign a unique value to this
key for differentiating records that may have similar names or addresses.
Ques: Define Primary key, Composite key, Foreign Key.
Ans: A primary key is a unique value that identifies a row in a table. Primary Keys are also indexed in the
database, making it faster for the database to search for a record.
When primary key constraint is applied on one or more columns then it is known as Composite Primary Key.
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.
Ques: Define RDBMS.
Ans: A relational database is a type of database. It uses a structure that allows us to identify and access data
in relation to another piece of data in the database. Often, data in a relational database is organized into
tables.
A relational database is a collective set of multiple data sets organized by tables, records and columns.
Relational database establish a well-defined relationship between database tables. Tables communicate and
share information, which facilitates data searcheability, organization and reporting. A Relational database use
Structured Query Language (SQL), which is a standard user application that provides an easy programming
interface for database interaction

SESSION2:CREATE AND EDIT TABLES USING WIZARD & SQL COMMANDS

Ques: What are Database objects?


Ans: Tables:
A table is a set of data elements (values) that is organized using a model of vertical columns(which are
identified by their name) and horizontal rows. A table has a defined number of columns, but can have any
number of rows. Each row is identified by the values appearing in a particular column identified as a unique key
index or the key field.
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.
The columns provide the structure according to which the rows are composed. For example, cFirstName, or
cLastName are fields in a row.
Rows or Records or Tuples:
A row also called a Record or Tuple represents a single, data item in a table. In simple terms, a database table
can be visualized as consisting of rows and columns or fields. Each row in a table represents a set of related
data, and every row in the table has the same structure.
Ques: How to create database in Apache OpenOffice base?
Ans: CREATING DATABASE USING OPENOFFICE
• To open OpenOffice, click Start>Programs>OpenOffice.org 4 > OpenOffice.org.
Alternatively, you can also double-click on the OpenOffice.org 4 shortcut on the desktop if available. You
should see a Window.
Select the option database to open the base application.
You should be guided through the Database Wizard for creating a database.
You can create a new database by selecting the option Create a new database.
You can also open an existing database file that you have already created by selecting the option Open an
existing database file. Click Next. A window will appear
Click Finish. The Save As dialog box appears as shown below.
Specify a name for the database in the File name: field and click Save. A window similar to the one displayed
below.
Click Finish. The Save As dialog box appears. Specify a name for the database in the File name: field and click
Save
Ques: List the different ways to create a Table in Databse.
Ans: There are different ways to create a table:
1. Create table in Design View
2. Use Wizard to Create Table
3. Using SQL query
Ques: Explain Datatypes.
Ans: Datatypes are used to identify which type of data (value) we are going to store in the database.
Fields themselves can be of different types depending on the data they contain. Data types in OpenOffice base
are broadly classified into five categories listed below.
• Numeric Types
• Alphanumeric Types
• Binary Types
• Date time
• Other Variable types
Numeric Types:
Numeric data types are used for describing numeric values for the field used in the table of a database. Numeric
data types in a database can be used for storing information such as mobile number, roll number, door number,
year of school admission, true or false statements, statistical values, etc.
The different types of numeric data types available are listed here.
Alphanumeric:

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. In general, files of any format can be stored using the binary data type. The
different types of binary data types available are listed here

DATE TIME:
Date time data types are used for describing date and time values for the field used in the table of a database.
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. The different types of date time data types available are listed here.

SESSION 3: PERFORM OPERATIONS ON TABLE


Ques: How to insert data in a table?
Ans: Inserting Data in The Table
To insert the data in the table, follow the steps:
Select the table > Double click on it. The table will open in Datasheet View in which new data can be inserted
and existing data can be updated or removed.
Ques: How to edit record in a table?
Ans: Editing Records in the Table
To edit the data either click on edit icon or double on the data in the cell of a table and modifications can be
done.
Ques: How to delete record from a table?
Ans: Deleting Records from the Table
To remove the data from the table, follow the steps:
Select the data > right click on selected data > select the Delete option
Ques: How will you set field properties?
Ans: To set the field properties, steps will be followed as:
Select the table > Right click > Select the option Edit > the table Design View window will open In design view
there are different properties of fields according to the data type set for each field.
Ques: Discuss the various properties of Numeric type data.
Ans: The properties of numeric type data is shown below .
Like AutoValue – if set to yes then field will get the auto numeric values.
Length – By default length of the field is 10 but the size of the field can be set to maximum length.
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.
Format example – This property helps to set the format of the data entered in the field such as 91-222-333.
Ques: Discuss the various properties of Character type data.
Ans: The properties of character type data is shown below
Entry Required – if set to yes then it will be must to insert the value in the field which means that field cannot
be left blank.
Length – By default length of the field is 10 but the size of the field can be set to maximum length.
Default Value – A default value can be set for a field if users don’t provide any value while entering the values
in the table.
Format example – This property helps to set the format of the data entered in the field such as 91-222-333.
Ques: Define sorting.
Ans: Sorting means to arrange the data in either ascending order or descending order. Select the column(s) then
click on sort buttons.

Ques: Define Referential Integrity and its uses.


Ans: 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
constraints.
Referential integrity helps to avoid:
Adding records to a related table if there is no associated record available in the primary key table.
Changing values in a primary if any dependent records are present in associated table(s).
Deleting records from a primary key table if there are any matching related records available in associated
table(s).
Ques: Define Relationship and uses of relationship in tables?
Ans: A relationship refers to an association or connection between two or more tables. When you relate two
tables, you don't need to enter the same data in separate tables.
Relationships between tables helps to:
Save time as there is no need to enter the same data in separate tables.
Reduce data-entry errors.
Summarize data from related tables.
Ques: How to create relationship between two Tables?
Ans: You can create a relationship between any two tables by selecting Relationships… option from the Tools
menu. Add the tables in amongst which you want to create the relationship. Select the tables and click on Add
button.
Ques: How many types of Relationship are in Tables?
Ans: There are three types of relationships which can be created in tables:
1. ONE to ONE
In this relationship, both the tables must have primary key columns. Example: In the given tables EMP and
DEPT, EMP_ID in EMP table and DEPT_ID in DEPT table are the primary keys.

2. ONE to MANY OR MANY to ONE


In this relationship, one of the table must have primary key column.
It signifies that one column of primary key table is associated with all the columns of associated table.
Example: In the given tables EMP and DEPT, EMP_ID in EMP table is the primary key.

3. MANY to MANY
In this relationship, no table has the primary key column.
It signifies that all the columns of primary key table are associated with all the columns of associated table.
Example: In the given tables EMP and DEPT, there is no primary key.
Ques: List the different ways to create the relationships between the tables.
Ans: There are two ways to create the relationships between the tables
a. Click on Insert option and select New Relation… option in Relation Design window. Select the options as
required:
b. Drag the primary key column from one table and drop it on the key column of another table.
Ques: How to remove the relationship between tables?
Ans: 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.
SESSION 4: RETRIEVE DATA USING QUERY
Ques: Define a query.
Ans: Query is to collect specific information from the pool of data. A query helps us join information from
different tables and filter that information. Filtering means that the query uses criteria you provide to hide
some data and present only what you want to see.
Ques: List the different ways to create query.
Ans: a) Create query in design view
b) Use wizard to create query
c) create query in sql view.
Ques: Define Structured Query Language.
Ans: Structured Query languages are computer languages used to make queries into databases and information
systems. Queries are commands that are used to define the data structure and also to manipulate the data in the
database.
Ques: What is the purpose of Select statement?
Ans: A SELECT statement retrieves zero or more rows from one or more database tables or database views. In
most applications, SELECT is the most commonly used Data Manipulation Language(DML) command.
The SELECT statement has many optional clauses:
• WHERE specifies which rows to retrieve.
• ORDER BY specifies an order in which to return the rows.
To retrieve all the columns in a table the syntax is:
SELECT * FROM <TABLENAME>;
Ques: How to execute queries?
Ans: In order to execute queries click on the Queries option available on the left side under database section,
click Create Query in SQL View. A window will appear
Type the query in the above window and execute it by using the F5 function key.
Ques: How to display data of same type of values?
Ans: Grouping of Data
To display the records containing the same type of values “WHERE” clause can be used with the Select SQL
Command.
To get details about the list of students whose favorite color is blue, you can use:
select * from SDetails where Color=’Blue’;
Ques: Explain Update statement.
Ans:UPDATE statement
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 [, column_name = value ...]
[WHERE <condition>];
SESSION 5: CREATE FORMS AND REPORTS USING WIZARD
Ques: Define a Form.
Ans: 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.
Ques: List the different ways to create a form.
Ans: a) Create form in design view
b) Use wizard to create form
Ques: Define Reports
Ans: A report helps to display the data in a summarized manner. It is used to generate the overall work outcome
in a clear format. You can create reports in the database.
Ques: List the way to create a report.
Ans: a) Use wizard to create a report

You might also like