0% found this document useful (0 votes)
24 views8 pages

DBMS Notes 1730956881

The document outlines key concepts in Database Management Systems (DBMS), including the differences between primary and foreign keys, the definition of RDBMS, and the types of database languages. It explains various database components such as tables, forms, and reports, as well as relationships between tables. Additionally, it provides SQL commands for data manipulation and highlights the importance of data integrity and security in databases.

Uploaded by

veenarao1819
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)
24 views8 pages

DBMS Notes 1730956881

The document outlines key concepts in Database Management Systems (DBMS), including the differences between primary and foreign keys, the definition of RDBMS, and the types of database languages. It explains various database components such as tables, forms, and reports, as well as relationships between tables. Additionally, it provides SQL commands for data manipulation and highlights the importance of data integrity and security in databases.

Uploaded by

veenarao1819
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/ 8

Database Management System (Advanced)

1. Difference Between Primary Key and Foreign Key


PRIMARY KEY FOREIGN KEY

A primary key is used to A foreign key is a column or group of


ensure data in the specific columns in a relational database table that
column is unique. provides a link between data in two tables.

It uniquely identifies a record


It refers to the field in a table which is the
in the relational database
primary key of another table.
table.

Only one primary key is Whereas more than one foreign key is
allowed in a table. allowed in a table.

It is a combination of
It can contain duplicate values and a table in a
UNIQUE and Not Null
relational database.
constraints.

It does not allow NULL


It can also contain NULL values.
values .

Its value cannot be deleted


Its value can be deleted from the child table.
from the parent table.

It constraint can be implicitly


It constraint cannot be defined on the local or
defined on the temporary
global temporary tables.
tables.

2. What is database server?


Ans: A Database Server is a computer that is dedicated to database storage and
retrieval.
3. What is RDBMS?
Ans: An RDBMS is a particular type of DBMS that uses a relational model for
its databases. It enables you to create relational database.
4. Explain two types of languages used for creating and manipulating the data
in database.(2 Marks)
Ans: Two types of languages used to create and manipulate data in a database
are Data Definition Language (DDL) and Data Manipulation Language
(DML):
Data Definition Language (DDL)
A data definition language is a computer language used to create and modify
the structure of database object in the database this database objects include
views, schemes, tabs index etc.
Data Manipulation Language (DML)
Data Manipulation Language (DML) DML provides various commands used
to access and Manipulate data in existing database. This manipulation involves
inserting data into database tables, retrieving existing data, deleting data from
existing tables and modifying existing data.
5. Explain any three data types in OpenOffice base.
Ans: In OpenOffice Base, which is a database management tool, you can use
various data types for organizing and storing information. Here are three
common data types:
1. Text (Varchar) : Used for storing text data such as names, addresses, or
descriptions. It allows for a variable number of characters and is ideal for
most textual information.
2. Number : Used for storing numerical data, such as quantities, prices, or
measurements. It supports various formats like integers or decimals,
depending on the precision needed.
3. Date : Used for storing dates, such as birthdates or transaction dates. It
helps in organizing and sorting data based on time-related information.
These data types help ensure that data is stored in a structured and appropriate
format for various needs.
6. Explain the following with respect to Database:
a. Forms
b. Reports
c. Table
Ans: In databases, these terms refer to different components used for managing
and presenting data:
(a) Forms : Forms are used to input and edit data in a database. They
provide a user-friendly interface for entering information into tables,
allowing users to fill out fields like text boxes and drop-down menus.
Forms make data entry easier and more organized.
(b) Reports : Reports are used to generate printed or digital summaries
of data. They present information in a structured format, often with
charts and tables, for analysis or sharing. Reports help in reviewing
and summarizing data for decision-making.
(c) Tables : Tables are the core structures in a database where data is
stored. They consist of rows and columns, with each row
representing a record and each column representing a field or
attribute of the data. Tables help in organizing and retrieving data
efficiently.
7. Explain the types of relationship that can be created in tables?
Ans: There are four relationships in database.
-One to One: One entity is associated with another entity. For Ex: Each
employee is associated with one department
-One to Many: One entity is associated with many other entities. For Ex: A
company is associated with all working employees in one branch/office/country.
- Many to One: Many entities are associated with only one entity. For Ex: Many
employees are associated with one project.
- Many to Many: Many entities are associated with many other entities. For Ex:
In a company many employees are associated with multiple
projects(completed/existing), and at the same time, projects are associated with
multiple employees.
8. Differences between Form and Report
Form Report
1. Form is primarily used for
entering data. 1. Report is used for presenting
2. Form is also used for the data.
displaying records but one 2. Report is used for displaying
record at a time. whole records.
3. Data can be modified through 3. Data can not be modified
the form. through report.
4. Form is designed to be used 4. Report are designed to be
on screen. printed.
9. What is Database Management System?
Ans: * It is application software that can be used to create and manage
database efficiently.
* it enable user or application to create, store, update, delete and retrieve data
from database itself.
* Examples of DBMS are MySQL, Oracle, MongoDB, MS Access, MS SQL
Server, FoxPro, SQLite etc.
10. What is database?
Database is an organized collection of interrelated data that has been recorded,
organized and made available for searching is called Database.
Advantages of Database
Reduced Data Redundancy: As different type of data are stored in different
tables within a single database, chances of repetition of data reduced to zero.
Data Integrity: Data integrity ensures that data stored in database is valid,
accurate and consistent in database. There are many data constraints present in
database that implements data integrity.
Data Consistency: it refers to same appearance of data across the database and
for all the users viewing the database. Moreover, any changes made to data are
instantly reflected to all its associated tables within a database and there is no
data inconsistency.
Data Privacy: there are data security rules that when applied can ensure the
accessibility scope of data at different levels to authentic users only.
Backup and Recovery: there is provision of automatic data backup that helps
to restore database in case of system failure or crash and keep data safe and
available.
Features of Database
* A database can have more than one table.
* Each table in a database contains information about one type of item.
* Every record must be unique in a table.
* Every table should have one or more fields designated as key.
* Sequence of Columns (fields) of table can be in any order Keys in Database
Primary key.
* It ensures each record is unique in a table. It is also indexed in database,
making it faster to search for records
* A table can have only primary key
* Primary key cannot have NULL values
Composite Primary Key
When Primary key constraint is applied on or more columns then it is known
as Composite primary key.
Foreign Key
* The field which is Primary key in another related table.
* Foreign key is used to establish relation between two tables.
* A table can have more than Foreign key
10. What is RDBMS?
Ans: RDBMS stands for Relational Database Management System. It was
developed by E.F. Codd at IBM 1970. It is used to organize collection of data
as a relation where relation corresponds to a table of values Often data in a
relational database is organized into tables.
SESSION 2: Create and Edit Table using Wizard & SQL Commands
Database Objects
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 type, one for each row of the
table.
* The columns provide the structure according to which the rows are
composed.
* For example, Item code, Item name 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.
Creating database in Open Office
1. Start Open Office
2. Select the option Database
3. In database Wizard dialog, select 'Create a new database' and click Next and
than click on Finish (with no change)
4. In Save As dialog, specify name for the database and click save
5. Database Window will be opened
11. What is Table?
Ans: Tables are the basic building blocks of a database which is used to store
data in the database.
12. How many ways we can create table in Open Office Base?
Ans: We can create table in two ways
* Create table using Wizard
* Create table in Design View
13. Insert some information into a table COLLEGE, whose structure is given
below.
Ans: (i) Mysql>INSERT INTO COLLEGE (ROLL_NO, NAME, CLASS,
BRANCH) VALUES(2, „VIKAS‟,12, „SCIENCE‟); (ii) Mysql>INSERT INTO
COLLEGE (ROLL_NO, NAME,CLASS, BRANCH) VALUES (3, „RAJ‟, 10,
„SCIENCE‟);
14. Write the queries for the following table: Item

a. Write a query to insert a new record of following details15, “Pencil”, 20, 10


Ans. Insert into Item values(15, “Pencil”, 20, 10)
b. Write a query to display detail of items whose quantity is more than 10.
Ans. Select * from Item where Qty > 10
c. Write a query to change the quantity of Item number 13 to 25.
Ans. Update Item set Qty = 25 where Itemno = 13
d. Display the total amount of each item. The amount must be calculated as the
price multiplied by quantity for each item
Ans. Select Price * Qty from Item.
e. Display the name of item whose price is 10.
Ans. Select Iname from Item where price = 10
f. Display all the records in ascending order of price.
Ans. Select * from Item order by Price asc.
g. Identify the Primary key from table Item.
Ans. Itemno
h. Write the suitable data type of field “Iname”.
Ans. Char or Varchar
i. Write a query to increase the price of all items by Rs2.
Ans. Update Item set Price = Price + 2;
j. Write a query to decrease the price of all items by Rs2 whose price is
less than 20.
Ans. Update Item set Price = Price – 2 where Price < 20;
16. What is referential Integrity?
Ans: Referential integrity is used to keep data maintained, accurate and
consistent. Data in Base can be connected between two or more tables using
primary key and foreign key constraints.
*Referential integrity helps to
a. If there is no connected record in the main key table, records are added to a
related table.
b. Changing values in a primary if there are any dependent records in the
linked table
c. If there are any matching linked records in an associated table, records from
a primary key table are deleted.
17. What is Form in OpenOffice Base?
Ans: A form provides the user a systematic way of storing information into
the database.
18. 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.

19. What is the file extension for databases <#> created using OpenOffice.Org
Base?
Ans: Extension for OpenOffice base is .odb.
20. List any three file formats that can be managed usingOpenOffice.Org
Base?
Ans: The three file formats are –
a. .odt –* This file format use for create digital document file
b. .odd –* This file format use for create spreadsheet
c. .odp –* This file format use for creating presentation file
21. What different types of keys are available in RDBMS?
Ans: The different keys available in RDBMS are –
a. Primary Key (PK) – A primary key is a unique value that identifies a row in a
table. If the primary key is defined to any table column it means the duplication
will be not allowed.
b. Composite Primary Key – When a primary key is applied to one or more
columns in the same table is known as Composite Primary Key.
c. Foreign Key (FK) – By default columns are foreign key, foreign key points to
the primary key of another table.
22. What is the purpose of using queries?
Ans: Queries are commands that describe the data structure as well manipulate
the data in the database. The purpose of a query is to do calculations, integrate
data from many tables, and add, alter, or delete data from a database.
23. Which clause of Select statement helps to display specific data?
Ans: Where clause is used to display specific data from the database.
24. Why there is a need to create Forms?
Ans: A form allows the user to enter information into a database in a systematic
manner. It is a user-defined interface that allows users to see, enter, and edit data
directly in database.
25. What is the purpose of creating Reports?
Ans: Reports help to present the data in proper manner which is stored in the
database, It also displays the data in summary format.
26. What are the prerequisites to create a Form and Reports?
Ans: Forms –
a. Forms help or manage to store data in a systematic format.
b. The prerequisites to create a form would be –
c. Add all the necessary fields in the form
d. Make the connection between form and the table
Reports –
a. Reports display the data in a summarized manner.
b. The prerequisites to create a report would be –
c. Data
d. Data source
27. Consider the following table “Students”

Write SQL commands:


a. To display all the information from the table whose address is
„Mumbai‟.
Answer – Select * from Students where address = “Mumbai”;
b. To list the details of all the students whose percentage is between 90 to 100.
Answer – Select * from Students where percentage >= 90 and percentage <=
100;
c. To display the name of all the students whose gender is Female.
Answer –Select Subject from Students where Gender = „F‟;
d. To display the list of names of all the students in alphabetical order.
Answer –Select * from Students order by Student_ name;

You might also like