Unit 3: DATABASE MANAGEMENT SYSTEM
1. In how many ways tables can be created in Base?
Ans. Tables can be created in two ways. 1. In Design view 2. Using Wizard
2. List datatypes available in Numeric Datatype? Ans. The different types of numeric data types
are: Boolean Numeric, Tinyint Decimal, Smallint Real, Integer Float, Bigint Double
3. List datatypes available in Alphanumeric Data Type?
Ans. The different types of Alphanumeric Data Type are: Longvarchar, Char, Varchar,
Varchar_Ignore Case
4. Define the structure of a table.
Ans. A table is a set of data elements (values) that is organized in vertical columns and
Horizontal rows. A table has a defined number of columns, but can have any number of rows.
5. Differentiate between Tuples and Attributes of a table
Ans. A row also called a Record or Tuple represents a single, data item in a table. Whereas A
column is a set of data values of a particular simple type, one for each row of the table.
6. Name different Binary data types.
Ans. The different Binary data types are: Longvarbinary, Binary, Varbinary
7. How many types of relationships can be created in Base? Explain each of them.
Ans. There are three types of relationship in OpenOffice Base.
ONE to ONE: In this relationship, both the tables must have primary key columns. Your record
in a table can have only one matching record in another [Link]: In the given tables EMP
and DEPT, EMP_ID in EMP table and DEPT_ID in DEPT table are the primary keys.
ONE to MANY: 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.
A record of table A iis associated with several matching records of table B
B.
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. In this
many records are associated with many records of another table. We cannot implement the
many to many relationship directly between the two tables we need one more table called join
table
8. What do you mean by Sorting? In how many ways it can be done?
Ans. Sorting means arranging elements in particular sequence. It can be done in two ways.
Increasing order, Decreasing Order
9. What is database? Give an example. What does DBMS stand for?
Ans. A collection of related information organised as tables is known as database e.g. INGRES,
MySQL etc. DBMS stands for DataBase Management System. It is a computer-based record
keeping system.
10. What is the difference between ‘Rows’ and ‘Columns’ in a table?
Ans. In a table, rows are called records and columns are termed a fields. A row stores complete
information of a record whereas column stores only similar data values for all records.
11. What is field in database? Give an example.
Ans. A field is an area, reserved for a specific piece of data. It is also known as attribute. e.g.
Customer Name.
12. Define forms and what is the need of using them? Ans. A form is a window or screen that
contains numerous fields or spaces to enter data. Forms can be used to view and edit your
data. It is an interface in user specified layout
13. What does RDBMS stand for?
Ans. RDBMS stands for Relational Database Management System. It is a type of DBMS that
stores data in the form of relations (tables).
14. How is data organized in a RDBMS?
Ans. A relational database is a type of database. It uses a structure that allows us to identify and
access datain relation to another piece of data in the database. Data in a relational database is
organized into tables.
15. Write the purpose of DBMS. Ans. DBMS is used to store logically related information at a
centralised location. It facilitates data sharing among all the applications requiring it.
16. Write any two uses of database management system.
Ans. The two uses of database management system are as follows (i) DBMS is used to store
data at a centralised location. (ii) It is used to minimise data redundancy and data inconsistency.
17. Write any two advantages of using database. Ans. The two advantages of using database
are as follows (i) It can ensure data security. (ii) It reduces the data redundancy.
18. Give any two disadvantages of the database.
Ans. The two disadvantages of the database are as follows (i) A database system creates
additional complexity and requirements. (ii) A database system is a multi-user software, which is
less efficient.
[Link] datatypes available in Numeric data type.
Ans. Datatypes available in numeric data type are TINYINT, SMALLCINT, MEDIUMINT, INT
and BIGINT.
20. What is the value of Entry Required field?
Ans. The value of this property can be Yes or No. If entry required is Yes, the field cannot be
absent i.e. should be necessarily present with a value.
21. What is table? Also, define Candidate Key.
Ans. A table consists of a number of rows and columns. Each record contains values for the
attributes. A candidate key is the smallest subset of the super key for which there does not
exist a proper subset that is super key. Any candidate key can be choosen to uniquely identify
the records, it is called primary key.
22. Define database management system.
The database management system is a computerised record keeping system or software that
enables you to create store modify and extract information from a database it allows different
user application programs to access the same database concurrently
23. Mention few advantages of database management system
Enforcement of data standards
Data availability
Reduced data redundancy
Minimise the data inconsistency
Data concurrency
Ensure data security
Backup and recovery management
24. What are different types of database management system
Relational database management system
Network database management system
Hierarchical database management system
Object oriented database management system
25. Explain concept of keys
Lucky place I important role in a relational database it is used for identifying unique records from
a Table it also establishes relationship among the tables
Primary key:
Yah primary ki is a set of one of more fields that uniquely identifies each record in a table it does
not contain any duplicate data a table can have only one primary key
Rules:
Primary key feel should be unique
The primary key feel cannot be null
The value in primary key field can never be modified or updated
Composite primary key:
A composite key or composite primary key refers to a combination of two or more attributes that
uniquely identify the record in a table
Foreign key:
Your foreign key is a field or set of field that is used to establish a relationship between the two
tables. Your primary key in another table is called as foreign key
Candidate key:
A table might have one or more feel that may uniquely identify the tuples. Search field or called
candidate key as their eligible to become a primary key
Eg: DOB, ID, DEP_ID
26. Mention the Database Objects
Database file is just like a container. It holds the following four database objects that are used to
create, ed Dulate the data in the database.
Tables are the building blocks of a database. They store data items in the form of rows and
columns. all the rows are referred to as records or tuples, and all the columns are known as
fields or attribut ple, in the Employee table, the data of related fields of the employees, such as
Emp_Code, Name, Depar , etc., is called a record and specific property of that employee, such
as Salary, is known as field.
Queries: As the name suggests, queries are used to ask questions from the tables of a
database, which store nt of data. Queries help to retrieve the filtered data from the database
tables, based upon some condition so used to insert, delete, and update the data in the
database depending upon the criteria specified by the user
Forms are the user-friendly interfaces that facilitate the process of inserting, editing, deleting,
and upda n tables and queries. It accepts the data from the user and stores it in the
corresponding table or query.
you can add and update one record at a time.
Reports: Reports are used to display the selected data in a printable format. Reports collect the
summarised da r more tables/queries and organise it in a printable form.
27. Define referential integrity
Differential integrity is a rule in RDBMS it takes that a foreign key must have a matching primary
key that is all its reference must be valid and the users cannot accidentally delete or amend the
data referential integrity does not allowed to enter at you record in the child table for which we
don't have any matching record in parent table
27. Mention the different feel properties explain
AutoValue: If set to Yes, the values for this data field is generated by the database engine.
Entry required: If set to Yes, this field must not be empty.
Length: It specifies the maximum number of characters for the data field.
Decimal places: It specifies the number of decimal places for the data field. This option is only
availab numerical or decimal data fields.
Default value: It specifies the default value for a Yes/No field.
Format example: This field property allows you to display data in a format that is different from
the way you actually store your data.
28. What are the different ways to create queries
The query wizard
The design view
The SQL view
29. Define structured query language ( SQL)
SQL is a language that allows to make query studio find the data structure and manipulate the
data in the database user can create and manipulate the database anytime by using the
structure query language commands.
Classification
DDL ( DATA DEFENITION LANGUAGE)
DML ( DATA MANIPULATION LANGUAGE)
29. DEFINE DDL
This commands are used to define and modify the structure of a database
Commands :
CREATE:Creates a new database or table
ALTER : Modifies the structure of a database
DROP : Deletes an existing database or table
TRUNCATE : removes all the records including allocated table space
RENAME: renames and existing database or table
30. Define DML
These commands allow the user to manipulate data in the database they help in retrieval
insertion television and modification of information present in the database
Commands :
SELECT: Retrieves data from the table
INSERT: inserts data into a table
UPDATE: updates the existing data with the new data
DELETE: delete the record from the table
CREATE COMMAND :
SYNTAX :
CREATE TABLE Table_name (Column_name1 Data type,
Column_name2 Data type,Column_name3 Data type,..); )
INSERT COMMAND:
Syntax:
INSERT INTO TABLE NAME
(Column1, Column2, Column3,...)
VALUES (Valuel, Value2, Value3,..);
Or
INSERT INTO TABLE NAME
VALUES (Value1, Value2, Value3,);
SELECT COMMAND :
SYNTAX :
The following clauses can be used with the SELECT command. These are optional, Le., you
can us requirement.
+ WHERE specifies which the rows to be retrieved.
+ ORDER BY specifies an order in which the rows are to be retrieved.
Retrieving All Records: The following syntax is used to retrieve all the records from a table of a
database
Syntax:
SELECT * FROM Table_name;
To retrieve data from all fields
SELECT * FROM TABLENAME
WHERE CONDITION;
To Retrieve records in ascending order
SEKECT * FROM TABLENAME
ORDER BY CONDITION;
UPDATE COMMAND:
UPDATE TABLENAME
SET COLUMN1= VALUE 1, COLUMN 2= VALUE 2,...
WHERE CONDITION ;
Tips
● To open database wizard shortcut key: Ctrl + N
● Shortcut key to open existing database: Ctrl+ O
● The extension of database file: .odb
● The two views in libro office base:
table data view
table design view