Jay MTech 2nd Sem LAB207

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

1

BABULAL TARABAI INSTITUTE OF RESEARCH &


TECHNOLOGY,
SAGAR(M.P.)

SESSION July 2021-22

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

MCSE-207

Lab-II [MCSE-207]

Submitted To Submitted By

Department of CSE Jay Jadiya

Enrol No.: 0608CS21MT05

[email protected]

MTech-CSE 2nd SEM


MTech-CSE 2nd SEM 0608CS21MT05 | Page: 2

List of Experiments
1. Introduction of system programming and its components.
2. To write a program to generate the symbol table for the given assembly
language.
3. Write a program to create a symbol table for a given high-level language
program.
4. Exploring various features of debug command and also use of LAX and
YACC tools.
5. Develop a database application to demonstrate storing & retrieving of BLOB
and CLOB objects.
6. Develop a database application to demonstrate representation of multi valued
attributes and use of nested tables to represent complex objects.
7. Explain E-R model with suitable examples.
8. To Study of ORDBMS language Query.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 3

Experiment 1 :-
Introduction of system programming and its components.
Systems Programming:-
Systems programming involves the development of the individual pieces of software
that allow the entire system to function as a single unit. Systems programming
involves many layers such as the operating system (OS), firmware, and the
development environment.

In more recent years, the lines between systems programming and software
programming have blurred. One of the core areas that differentiates a systems
programmer from a software programmer is that systems programmers deal with the
management of system resources. Software programmers operate within the
constraints placed upon them by the system programmers.

This distinction holds value because systems programming deals with “low-level”
programming. Systems programming works more closely with computer resources
and machine languages whereas software programming is primarily interested in
user interactions. Both types of programming are ultimately attempting to provide
users with the best possible experience, but systems programmers focus on
delivering a better experience by reducing load times or improving efficiency of
operations.

It’s imperative that everyone working within the system is aligned. The primary goal
of any service or product is to deliver value to your customers. Whether you are
involved with top-level user interactions or low-level system infrastructure, the end
goal remains the same. This is why a company culture that supports teamwork and
goal-alignment is so important for technology companies.

Modern customers have increasingly high expectations. As such, organizations must


constantly be seeking ways to improve their output to provide customers with an
ever-improving product. Achieving this is done through intelligent systems design
and an agile approach to development. Bringing everyone together to work towards
a singular goal is the main pursuit of the DevOps approach to software development.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 4

Systems programming components:-

1) Loader
Loader plays an important role in system programming. It palaces the program in the
main memory and prepare it for
execution. Loading program means reading contents of executable file and loading
program in the memory and then
carryout tasks and prepare them for running, as the loading is complete the operating
system starts the program
execution by passing control to program code.

2) Assembler
An assembler is used to convert assembly language program into machine level
language. Assembler provides access to
Software and Application developers to manage computer hardware and its
components. Assembler act as a compiler
of assembly language program.

3) Compiler
A Compiler is program used to convert high level programming language to low
level programming language.
Compilers are a type of translator that translates digital devices and computer
languages.
Further compiler is divided into two types:-
i) Cross Compiler: A cross compiler is a compiler which is capable of generating an
executable code for other platform
where it resides on another platform.
ii) Source to Source Compiler: A source to source compiler accepts an input written
in one programming language and
produces output for same written in another language.

4) Macro
A macro is a single line abbreviation for group of statements or block of code.
Macro allows programmer to write the
short part of the program. A macro can be expanded into no. of instructions.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 5

5) Interpreter
In System Programming interpreter is a program which directly executes the
program without compiling it to the
machine language.
The below program shows the use of all components of system programming:
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 6

Experiment 2 :-
To write a program to generate the symbol table for the given
assembly language.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 7
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 8

Experiment 3 :-
Write a program to create a symbol table for a given high-level
language program.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 9
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 10
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 11
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 12

Output:
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 13

Experiment 4 :-
Exploring various features of debug command and also use of LAX
and YACC tools.

Lexical Analyzer

Algorithm:
Step 1: Start Step 2: Read the file and open the file as read mode. Step 3: Read the
string for token identifiers, variables.
Step 4: Take parenthesis also a token.
Step 5: Parse the string
Step 6: Stop
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 14
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 15
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 16
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 17

Output:
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 18

Experiment 5 :-
Develop a database application to demonstrate storing & retrieving
of BLOB and CLOB objects.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 19

Experiment 6 :-
Develop a database application to demonstrate representation of
multi valued attributes and use of nested tables to represent
complex objects.

Introduction
Attributes (like phone numbers) that are explicitly repeated in a class definition are
not the only design problem that we might have to correct. Suppose that we want to
know what hobbies each person on our contact list is interested in (perhaps to help
us pick birthday or holiday presents). We might add an attribute to hold these. More
likely, someone else has already built the database, and added this attribute without
thinking about it.

The multivalued attribute is obvious in this example as its name is in plural. Be


aware that this won’t always be the case. We can only be sure that there’s a design
problem when we find data in a table as depicted below.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 20

In this case, the hobby attribute wasn’t repeated in the scheme, but there are many
distinct values entered for it in the same column of a row. This is called a
multivalued attribute. The problem with this design is that it is now difficult (but
possible) to search the table for any particular hobby that a person might have, and it
is impossible to create a query that will individually list the hobbies that are shown
in the table. Unlike the phone book example, NULL is probably not part of the
problem here, even if we don’t know the hobbies for everyone in the database.

Using UML Multiplicity for multivalued attributes


In UML, we can again use the multiplicity notation to show that a contact may have
more than one value for hobby.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 21

Mapping to the relational model As you should expect by now,


we can’t represent the multivalued attribute directly in the Contacts relation scheme.
Instead, we will model it using its own relation scheme. Thus, we remove the old
hobbies attribute and create a new scheme, very similar to the one that we created
for phone numbers in the repeated attribute design pattern.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 22

The relationship between Contacts and Hobbies is one-to-many, so we create the


usual pk-fk pair. The new scheme has only one descriptive attribute, the hobby
name. To uniquely identify each row of the table, we need to know both which
contact this hobby belongs to and which hobby it is—so both attributes form the pk
of the scheme.

With data entered, the new table looks similar to the PhoneNumbers. It can also be
joined to Contacts on matching pk-fk contactID pairs, re-creating the original data in
a form that we can now conveniently use for queries.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 23

Experiment 7 :-
Explain E-R model with suitable examples.
Entity relationship (ER) models are based on the real-world entities and their relationships. It is
easy for the developers to understand the system by simply looking at the ER diagram. ER
models are normally represented by ER-diagrams.

Components
ER diagram basically having three components:

● Entities − It is a real-world thing which can be a person, place, or even a


concept. For Example: Department, Admin, Courses, Teachers,
Students, Building, etc are some of the entities of a School Management
System.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 24

● Attributes − An entity which contains a real-world property called an


attribute. For Example: The entity employee has the property like
employee id, salary, age, etc.
● Relationship − Relationship tells how two attributes are related. For
Example: Employee works for a department.

An entity has a real-world property called attribute and these attributes are defined
by a set of values called domain.

Example 1

In a university,

● A student is an entity,
● University is the database,
● Name and age and sex are the attributes.
● The relationships among entities define the logical association between
entities.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 25

Example 2

Given below is another example of ER:

In the above example,

Entities − Employee and Department.

Attributes −

● Employee − Name, id, Age, Salary


● Department − Dept_id, Dept_name

The two entities are connected using the relationship. Here, each employee works
for a department.

Features of ER
The features of ER Model are as follows −

● Graphical Representation is Better Understanding − It is easy and


simple to understand so it can be used by the developers to
communicate with the stakeholders.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 26

● ER Diagram − ER diagrams are used as a visual tool for representing


the model.
● Database Design − This model helps the database designers to build the
database.

Advantages

The advantages of ER are as follows −

● The ER model is easy to build.


● This model is widely used by database designers for communicating
their ideas.
● This model can easily convert to any other model like network model,
hierarchical model etc.
● It is integrated with the dominant relational model.

Disadvantages

The disadvantages of ER are as follows −

● There is no industry standard for developing an ER model.


● Information might be lost or hidden in the ER model.
● There is no Data Manipulation Language (DML).
● There is limited relationship representation.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 27

Experiment 8 :-
To Study of ORDBMS language Query.

What is ORDBMS
ORDBMS (Object Relational Database Mangement System) is an improved version
that uses OODBMS ( Object-Oriented Database Mangement System). OODBMS is
a DBMS that allows using OO programming language techniques in data
management. While it improves performance and flexibility and reduces development
costs in comparison to RDBMS, it has some disadvantages such as additional costs
for computing resources, possibilities of design errors and data inconsistency.
ORDBMS provides solutions to these issues.

ORDBMS is a DBMS that is based on the relational model and the object-oriented
database model. Therefore, we can consider an ORDBMS as an RDBMS as well. In
other words, ORDBMS is used both as an RDBMS and an ORDBMS.

It supports objects, classes, inheritance and provides a better interface to many OO


languages. It also supports data model extensions with custom data types and
methods. Companies such as Microsoft, Oracle and Sybase have released the object-
relational versions of their products. It is more suitable for applications that proces

Difference Between RDBMS and ORDBMS

Definition
RDBMS is a database management system based on the relational model of data while
ORDBMS is a DBMS that is similar to RDBM but with an object-oriented database
model. Thus, this is the main difference between RDBMS and ORDBMS.

Stands for
While RDBMS stands for Relational Database Management System, ORDBMS
stands for Object Relational Database Management System.
MTech-CSE 2nd SEM 0608CS21MT05 | Page: 28

Data Model
Another difference between RDBMS and ORDBMS is that RDBMS is based on
Relational data model while ORDBMS is based on the Relational as well as Object
Oriented database model.

Applications
Furthermore, RDBMS is suitable for traditional application tasks such as data
administration and processing while ORDBMS is suitable for applications with
complex objects. Hence, this is also a difference between RDBMS and ORDBMS.

Examples
MS SQL server, MySQL, SQLite, MariaDB are some examples of RDBMS while
PostgreSQL is an ORDBMS.

Conclusion
RDBMS and ORDBMS are database management systems. The main difference
between RDBMS and ORDBMS is that RDBMS is DBMS based on the Relational
model while ORDBMS is a DBMS based on the Relational model and object-oriented
database model. In brief, ORDBMS is an extended version of RDBMS.

You might also like