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

Database Management System

The document provides an overview of database management systems, including definitions of data types, keys, and SQL commands. It outlines steps for creating tables, queries, and reports, as well as the importance of referential integrity and data manipulation. Additionally, it discusses the advantages of using a DBMS, such as reducing data redundancy and inconsistency.
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)
13 views

Database Management System

The document provides an overview of database management systems, including definitions of data types, keys, and SQL commands. It outlines steps for creating tables, queries, and reports, as well as the importance of referential integrity and data manipulation. Additionally, it discusses the advantages of using a DBMS, such as reducing data redundancy and inconsistency.
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/ 4

Part B

Unit 3: Database Management System


D. Short answer type questions
1. Data can be textual, numeric, or alphanumeric, and may include various other characters. Data
can be structured or unstructured. One cannot make any statement or draw any conclusion by
looking at the unstructured or raw data, whereas information refers to the organised, classified,
or processed data. Information is extracted from data.
2. To set a primary key in an existing table, follow these steps:
a. In the Tables pane, right-click on the name of the table in which the primary key is to be
set.
b. Select the Edit option in the context menu. The Table Design window of the selected table
appears.
c. Right-click on the field header for the row that is to be set as the primary key.
d. Select the Primary Key option in the context menu.
e. Click on the Save button.
3. Referential integrity refers to the constraints that are used to maintain the accuracy and
consistency of data in a relationship.
4. The numeric data types available in Base are BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT,
NUMERIC, DECIMAL, REAL, FLOAT, and DOUBLE.
5. Data Definition Language includes a set of SQL commands that are used to define or create
different structures in a database. DDL statements are used to create, modify, or remove a
database and its objects, such as tables, forms, and reports.
6. In SQL, the DROP command is used to delete a table from the database.
7. CHAR data type is used for storing characters. When defined as CHAR(n), the field can store a
fixed number of characters, specified by a user as n.
VARCHAR is called a variable character. When defined as VARCHAR(n), it means that the
maximum numbers of characters the field can store is n. However, if the actual characters
storedare less than the defined limit n, it occupies less space.
8. To create a query using SQL view, follow these steps:
a. Open the database in which you want to create a query.
b. Select the database object ‘Queries’.
c. Click on the ‘Create Query in SQL View’ option in the task pane. The ‘Query Design’ window
appears.
d. In the ‘Query Design’ window, type the SQL commands.
e. Click on the ‘Run Query’ button. The result will be displayed.
9. Data Manipulation Language includes the set of SQL commands that are used to edit or
manipulate the data stored in a database. SELECT, INSERT, UPDATE, and DELETE are commonly
used DML commands.
10. A form is a database object that provides the user with a convenient way of storing data
in the database. It provides an easy-to-understand interface to view, enter, and change data in
databaseobjects such as tables.
E. Long answer type questions
1. In a database, a key is that column that can be used to uniquely identify each record of a table.
There are times when we need to combine data from two or more tables and obtain the result.
In such scenarios, keys are used to relate two or more tables. Therefore, the database key is
used to create relations within a table or among tables.
In a relational database, three different types of keys are:
➤ Primary Key: This key is a field that contains a unique value for each row. Hence, a primarykey
uniquely identifies any record in a table. A table can have one or more primary keys.
➤ Composite Primary Key: When a primary key is defined using more than one field or column,
it is called a Composite Primary Key.
➤ Foreign Key: In a database, a foreign key refers to a field (column) or a set of fields (columns)
that is used to establish a relation between multiple tables. A foreign key is a primary key of
another table.
2. The steps to create a table named Students in the Design View are:
a. Open an existing database or create a new database.
b. Click on the ‘Tables’ object button. The ‘Tasks’ pane displays options for the table creation.
c. Select the ‘Create Table in Design View’ option. The ‘Table Design’ window appears.
d. In the ‘Field Name’ column, enter the name of a field such as Roll_No. In the ‘Field Type’
column, select the desired data type from the drop-down list. Likewise, you can add more
fields.
e. Once all the required fields are added, click on the ‘Save’ button in the ‘Table Design’window.
The ‘Save As’ dialog box appears.
f. In the ‘Table Name’ text box, assign the name ‘Students’ to the table.
g. Click on the ‘OK’ button. The ‘LibreOffice Base’ message box appears.
h. Click on the ‘Yes’ button if you want a primary key to be created automatically, else click on
the ‘No’ button.
i. Click on the ‘Close’ button in the ‘Table Design’ window. The table is created with the name
‘Students’ and displayed in the Table pane.
3. DBMS stands for Database Management System. It is a specialised software that can be usedto
manage databases. A DBMS includes specialised features, such as creating the database,
inserting records, updating records, retrieving information, controlling access to the database,and
so on.
The three advantages of DBMS are:
➤ Reduces Data Redundancy: DBMS minimises data redundancy by storing all the data in one
central place called a database.
➤ Reduces Data Inconsistency: Using a DBMS, one can ensure that data is always consistent.
DBMS makes sure that changes made in one place will always be updated in other places.
➤ Allows Data Sharing: A database allows data to be shared among multiple users. This means
that multiple users can access and modify the database simultaneously from remote locations.
4. The steps to create a report in LibreOffice Base are as follows:
a. Open an existing database in which you want to create a report.
b. Click on the ‘Reports’ object button in the ‘Tasks’ pane. Select the ‘Use Wizard to Create
Report’ option. The ‘LibreOffice Field Selection’ page of ‘Report Wizard’ appears.
c. Select the required table or query whose fields you want to add to the report from the
‘Tables or queries’ drop-down list. Select the required fields from the ‘Available fields’ list
box.
d. Click on the ‘Add’ button. The selected fields will be displayed in the ‘Fields in report’ list
box.
e. Click on the ‘Next’ button. The ‘Labeling fields’ page of the ‘Report Wizard’ appears. Here,
you can edit the labels for the fields that you want to display in the report.
f. Click on the ‘Next’ button. The ‘Grouping’ page appears. Here, you can select the field to
group the data.
g. Click on the ‘Next’ button. The ‘Sort options’ page appears. You can select the field based
onwhich you want to sort and the type of sorting, i.e., Ascending or Descending.
h. Click on the ‘Next’ button. The ‘Choose Layout’ page appears. Select the layout design of
thedata from the ‘Layout of data’ list box. Select the layout style of the header and footer
from the ‘Layout of headers and footers’ list.
i. Click on the ‘Next’ button. The ‘Create report’ page appears. In the ‘Title of report’ text box,
assign the name for the report. Select the appropriate radio buttons under the ‘What kind
of report do you want to create?’ and ‘How do you want to proceed after creating the
report?’ sections.
j. Click on the ‘Finish’ button. The report is created.
5. The steps to insert data in a table are:
a. Right-click on the table name in which you wish to insert data.
b. In the context menu, select the ‘Open’ option. The ‘Table Data View’ appears.
c. Enter the required data in the fields.
d. Press the Right arrow key or Tab key or Enter key to move the cursor to the next field.
e. Click on the ‘Save current record’ button on the toolbar.
6. The One-to-One relationship allows a connection between a single record in the first table to
a single record in the second table and vice versa. On the other hand, the One-to-Many
relationship exists when one record or an instance of an entity in a table can be associated
withmore than one record or instance in another table.
7. Wildcard characters refer to the special characters, which can be used in a query to find and
replace one or multiple characters. These characters help in searching data within a table
basedon a defined pattern.
➤ The ‘*’ (asterisk) wildcard represents zero or more characters.
➤ The ‘?’ (question mark) wildcard represents a single character.
➤ The ‘#’ (hashtag) wildcard represents any single numeric character.
➤ The ‘!’ (exclamation mark) wildcard represents any character not in the brackets.
➤ The ‘_’ (underscore) wildcard represents a range of characters.
➤ The ‘[]’ (square bracket) wildcard represents any single character enclosed in the brackets.
8. Data Inconsistency: The chances of data inconsistency increases when the similar data is stored
at multiple locations. For example, in a school database, if a clerk updates the address of a
student in one table, and does not modify the same in the other related tables, then there will
be multiple mismatching copies of the same data. Such a situation leads to data inconsistency,
and it will be difficult to find out which address is correct.
Data Redundancy: The term redundancy is referred to the duplication of data. For example, ina
college, a student is enrolled for more than one course. In such a situation, the information
regarding the student is stored in more than one place. Each course will require a separate
entry. Therefore, there will be duplication or repetition of data. Redundancy of data also leads to
higher storage costs and increased time for access.
9. In a table, each field contains different types of data. A field’s data type lets you control the type
of data that can be entered in a field.
Date/Time data type stores date and time values. You can display the date and time in different
formats. The Date and Time data types in LibreOffice Base are described in the table below.

Name Description
Date It can store a month, day, and year in the mm/dd/yyyy format.
Time It can store data about time, i.e. hour, minute, and second in
hh:mm:ss format.
Timestamp It can store both date and time information combined.

10. The rules to define a Primary key are:


➤ A Primary key must contain values that are unique.
➤ A column with a primary key cannot contain null values.
➤ Each table can have only one primary key.

F. Application-based questions
1. a.
Column Name Type Size
Item_No. integer 10
Item_Name varchar 15
Price decimal 5, 2
Quantity integer 3
b.
i. SELECT Price * QuantityFROM Item;
ii. SELECT * FROM Item
WHERE “Price” < 50;
2.
a. SELECT* FROM Hospital
WHERE “Department” = ‘Cardiology’;
b. SELECT Name FROM Hospital
WHERE “Gender” = ‘F’ AND “Department” = ‘Orthopaedic’;
c. SELECT Name, Date_of_AdmissionFROM Hospital
ORDER BY Date_of_Admission ASC;
d. SELECT Count (Age)FROM Hospital WHERE “Age” > 20;
3.
a. SELECT Name FROM Graduate
WHERE “Division” = ‘First’ORDER BY Name;
b. INSERT INTO “Graduate” (Name, Subject, Average Marks, Division) VALUES (‘Kajol’,
‘Computer’, ‘7s5’, ‘First’)

You might also like