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

CYCLE TEST 1

4 MARKS:
1.Differen ate between file processing system and DBMS.
Already wri en

2) Define DBMS, data catalog?

Metadata is data that provides informa on about other data.


In other words, it’s “data about data” It consists of labels or
markers that describe informa on, making it easier to find,
understand, organize, and use.
Metadata can be employed with a wide range of data
formats, encompassing documents, images, videos,
databases, and beyond.
3) Discuss the three levels of data abstrac on.
4) Discuss the two types of DML.

Data Manipulation Language (DML) Types


There are two types of DML, divided into the High-Level or Non-Procedural
DML and the Low-level or Procedural DML.

 High-Level or Non-Procedural DML


 It is set for a particular time or is highly series oriented
 Only applied to determine very complex operations within the database
 Prescriptive by nature
 Specify the data that is required
 Does not state how or when to avail the data
 For example, Every SQL statement is a prescriptive command issued.
 Low-level or Procedural DML
 Called track-at-a-time DML
 Consolidated as a programming language for general purpose
 Necessary in nature
 Clearly state which data to access and how
 Example: DB2’s SQL PL, Oracle’s PL/SQL

Features of DML

 Runs only data interpretation queries


 Used in database schema to recall or manipulate data
Meanwhile, DML commands are given below:

Step 1: Select Command- start by giving a command, which is applied to


get information out of the database. This also allows the database users to
get the crucial data they require from an OS, while also transferring a track
result established from one or more of the tables.

See below for example of a command:

Syntax :

SELECT *

ROM <table_name>;

Example :

SELECT *

FROM books;

OR

SELECT *

FROM books

where book_id=120;

Step 2: INSERT Command –This is used to submit the information or values


into a row. With the help of this instruction, we would be able to connect a
single or multiple records to one table within a repository. This is often used
to fix an unused tag to the document.

Syntax :

INSERT INTO <table_name> (‘column_name1’ <datatype>, ‘column_name

VALUES (‘value1’, ‘value2’);

Step 3: Update Command- used to modify the existing table records. It


changes the data from one or more records in a table, thus it is used to
modify data within a table.

Syntax :

UPDATE <table_name>
SET <column_name = value>

WHERE condition;

Step 4: Delete/Erase Command- used to delete a few or the entire data


from the earlier table. If the “where” condition is not input, then all the rows
would be eliminated.

Syntax :

DELETE FROM <table_name>

WHERE <condition>;

Advantages of DML

 Modify the data stored within the database


 Deliver effective human contact with the machine
 Could determine what data is needed
 DML offer several varieties and operations between the vendors that deliver the
database

Disadvantages of DML

 Cannot be used to modify the database’s structure


 Restrict the table view, that is, DML could hide some table columns
 Access data without storing it in the device
 Should not be used to create or delete sections or lists

5)Relate object, en ty, a ributes.


1. Entity:
 An entity is a real-world object or concept with an independent
existence that can be uniquely identified.
 In a database, an entity is represented as a table. Each row in the table
corresponds to an instance of that entity, and each column represents a
property or attribute of the entity.
2. Object:
 In the context of a DBMS, the term "object" is sometimes used
interchangeably with "entity."
 In a broader sense, an object can refer to an instance of a class in
object-oriented programming. However, in the database context, we
often use the term "entity" more specifically to denote the structure
that holds related data.
3. Attribute:
 An attribute is a characteristic or property that describes an entity.
 In a database table, attributes are represented as columns. Each column
contains data related to a specific attribute of the entity.
 For example, if we have an entity "Student," attributes might include
"StudentID," "Name," "Age," and "Grade."
6.Summarize en ty set and rela onshipset.
Entity Set: An Entity is an object of Entity Type and a set of all entities is
called an entity set. For Example, E1 is an entity having Entity Type Student
and the set of all students is called Entity Set. In ER diagram, Entity Type is
represented as:
A set of relationships of the same type is known as a relationship set. The
following relationship set depicts S1 as enrolled in C2, S2 as enrolled in C1,
and S3 as registered in C3.

7.Differen ate descrip ve a ributes and composed


a ributes.

Descrip ve a ribute in ER model

The a ribute(s) used for describing the rela onship is called descrip ve
a ributes, also referred as rela onship a ributes. They are actually used for
storing informa on about the rela onship. A rela onship can have zero or
more a ributes.
Let us consider an example ER diagram given below:
8.Discuss ER Model.
Wri en
9.Interpret DDL and list out the DDL commands
DDL(Data Defini on Language) : DDL or Data Defini on Language actually
consists of the SQL commands that can be used to define the database schema.
It simply deals with descrip ons of the database schema and is used to create
and modify the structure of database table in the database.
Examples of DDL commands:
• CREATE – is used to create the database or its objects (like table, index,
func on, views, store procedure and triggers).
• DROP – is used to delete table from the database.
• ALTER-is used to alter the structure of the database.
• TRUNCATE–is used to remove all records from a table, including all spaces
allocated for the records are removed.
• COMMENT –is used to add comments to the data dic onary.
• RENAME –is used to rename an table exis ng in the database.
CREATE :
CREATE TABLE TABLE_NAME (COLUMN_NAME DATATYPES[,....]);
DROP:
DROP TABLE TABLE NAME;
ALTER (ADD NEW COLUMN) :
ALTER TABLE table_name ADD column_name C OLUMN-defini on;
ALTER (MODIFY) :
ALTER TABLE MODIFY(COLUMN DEFINITION.... );
TRUNCATE: TRUNCATE TABLE TABLE NAME;
RENAME: RENAME OLD TABLE NAME TO NEW TABLE NAME;

10.Interpret DML and list out the DML commands.


DML(Data Manipula on Language) : The SQL commands that deals with the
manipula on of data present in the database belong to DML or Data
Manipula on Language and this includes most of the SQL statements.
Examples of DML: • INSERT – is used to insert data into a table.
• UPDATE – is used to update exis ng data within a table.
• DELETE – is used to delete records from a database table.
• Merge: It performs UPSERT opera on, i.e., insert or update opera ons.
• Call: It is used to call a structured query language .
• Explain Plan: It has the parameter of explaining data.
• Lock Table: It controls concurrency.
INSERT:
INSERT INTO TABLE_NAME (col1, col2, col3,.... col N) VALUES (value1, value2,
value3, .... valueN);
INSERT:
INSERT INTO TABLE_NAME VALUES (value1, value2, value3, .... valueN);
• For example:
UPDATE: UPDATE table_name SET [column_name1= value1,...column_nameN =
valueN] [WHERE CON DITION]
DELETE:
DELETE FROM table_name [WHERE condi on];
11.Discuss the two types of database architecture with neat diagram
12)Paraphrase the applica ons of Database systems

13. Differen ate simple a ributes and mul valued a ributes.


14. Paraphrase the different types of users in database system.
• Different types of user interfaces have been designed for the different types
of users.
• There are four different types of database-system users can be classified

15.Discuss data independence, and types of data independence.

You might also like