Sie sind auf Seite 1von 17

DMS Assignment A

Q1. What are the disadvantages of flat-file system?


Answer: Flat File Databases: Data stored on an ICT system is stored and organised in files.
When the data is organised in rows and columns with data values being repeated, it is called a
flat file.
A flat file looks like a spreadsheet; it is two dimensional and has no related files (or tables). Flat
files are easy to create and use (for small amounts of data). Data is often repeated in a flat file
and therefore they can be quite large in size.

In the example above, each subject that the pupil studies has to be entered as a separate record.
Redundancy: this file has a very simple row and column structure. There are no relationships
between data. The main weakness of this type of file is that data has to be repeated.
Data Integrity: The more often data has been recorded the higher the possibility of the data
having an error or inconsistency. The user of the data must be able to rely on the correctness
and accuracy of the data. The correctness, reliability and accuracy of the data is called data
integrity.
Disadvantages of flat file databases:

The computer has more data to read through, so accessing and searching through them
can be slow.
Data has to be repeated and leads to inputting errors and inconsistencies
File sizes can be large due to repeated data

Q2. What are different database constraints?


Answer: Primary Key Constraint / Foreign Key Constraints / Check Constraints.
An RDBMS enables data sharing between users. At the same time, you can ensure consistency of
data across multiple tables by using integrity constraints. An RDBMS uses various types of data
integrity constraints. These types include entity, column, referential and user-defined constraints.
The constraint, entity, ensures uniqueness of rows, and the constraint column ensures
consistency of the type of data within a column. The other type, referential, ensures validity of
foreign keys, and user-defined constraints are used to enforce specific business rules.
An RDBMS minimizes the redundancy of data.
NOT NULL constraints : NOT NULL constraints prevent null values from being entered into
a column.

Unique constraints : Unique constraints ensure that the values in a set of columns are unique and
not null for all rows in the table. The columns specified in a unique constraint must be defined as
NOT NULL. The database manager uses a unique index to enforce the uniqueness of the key
during changes to the columns of the unique constraint.
Primary key constraints: You can use primary key and foreign key constraints to
define relationships between tables.
(Table) Check constraints : A check constraint (also referred to as a table check
constraint) is a database rule that specifies the values allowed in one or more columns of every
row of a table. Specifying check constraints is done through a restricted form of a search
condition.
Foreign key (referential) constraints : Foreign key constraints (also known as referential
constraints or referential integrity constraints) enable you to define required relationships
between and within tables.
Informational constraints : An informational constraint is a constraint attribute that can be used
by the SQL compiler to improve the access to data. Informational constraints are not enforced
by the database manager, and are not used for additional verification of data; rather, they are
used to improve query performance.
Q3. What is the difference between internal & external schema?
Ans. Three-schema Architecture
Reminder: A schema is a description of the structure of the database
Internal level has an internal schema
Conceptual level has a conceptual schema
External level usually has several external schemas
Note that each of these schemas are only descriptions of data; the data really only exists at the
physical level
External Level
The end user is presented with special views that are tailored to their specific needs
Some of these views may be forms to fill out, others for interactive retrieval of information, etc.
Many different views may be available that are completely different that the way the base tables
are arranged
Conceptual or logical level
Description of the structure of the entire DB
Hides the details of physical storage
Concentrates on describing entities, data types, relationships, user operations, and constraints.
In the relational model, this is the base tables
Changes at this level can be made without having any effect on the external level
Internal Level
This is a description of the physical storage structure of the database
Operations performed here are translated into modifications of the contents and structure of the
files

Q4. What are the characteristics of data in the database?


Ans. Characteristics of the data in the Database Management System
1. Sharing of the data takes place amongst the different type of the users and applications.
2. Data exists permanently.
3. Data must be very much correct in the nature and should also be in accordance with the
real world entity that they represent.
4. Data can live beyond the scope of the process that has created it.

5. Data is not at all repeated.


6. Changes that are made in the schema at one level should not at all affect the other
levels.
Advantages of the Database Management System
1. Helps in reducing the complex nature of the systems environment due to the central
control or the management of the data, access, utilization and the security.
2. Reduces the data redundancy and also the inconsistency as the same data elements
are not at all repeated.
3. Also promotes the integrity of the data throughout the system or an organization.
4. Provides for the central control of the data creation and also for the definition.
5. Reduces or completely finishes the confusion that creeps in to the data.
6. Reduces the costs relating the program development and the maintenance.
7. Separates the logical view and the physical arrangement.
8. Reduces the program data dependence.
9. Permits the ad hoc queries.
10. Provides flexibility in the information systems.
11. Increases access and availability of the information.

Q5. What are the views ? How are they useful?


A database view displays one or more database records on the same page. A view can display some or
all of the database fields. Views have filters to determine which records they show. Views can be
sorted to control the record order and grouped to display records in related sets. Views have other
options such as totals and subtotals.
Most users interact with the database using the database views. A key to creating a useful database is a
well-chosen set of views. Luckily, while views are powerful, they are also easy to create.
Let's start by looking at an example view called Location from a Training Schedule database. This
view shows the 2003 training schedule, sorted by the cities where the classes were held:

All the views available for a database appear in the view selector (the View by list).
You can customize all aspects of a view, including:
The name of the view
The fields that appear in the view
The column title for each field in the view
The order of the fields in the view
The width of columns in the view, as well as the overall width of the view
The set of records that appear in the view (Filtering)
The order in which records are displayed in the view (Sorting & Grouping)
Column totals for numeric and currency fields (Totaling & Subtotaling)
In addition to seeing the view on screen, users can also print out the view on paper. They can do this
using the built-in print button or by using a defined report, which allows you to customize details of
the print out.
Views are basically a join of two or more underlying database tables. Certain tables are logically
related and make sense and more meaning when viewed linked together. Instead os making
these joins at runtime and increasing overheads, views when existing can provide information
readily such as in Search Helps in data entry screens.
Another example is when there is a table with many fields and it does not make a lot of sense to
see all of them together everytime, it is better we project only certain columns that we want to
see.
There are four types of views:
a) Database View (Generally used a a read only view)
b) Maintenance View (Used as a means to maintain the underlying tables participating in the
view)
c) Projection View (Single table view)
d) Help View (used in 'search helps' got by pressing F4)

Q6. What is the difference between Union & Set Intersection Operation?
Ans: The UNION, EXCEPT, and INTERSECT operators all operate on multiple result sets to return a single
result set:

The UNION operator combines the output of two query expressions into a single result set. Query
expressions are executed independently, and their output is combined into a single result table.
The EXCEPT operator evaluates the output of two query expressions and returns the difference
between the results. The result set contains all rows returned from the first query expression except
those rows that are also returned from the second query expression.
The INTERSECT operator evaluates the output of two query expressions and returns only the rows
common to each.

The following figure illustrates these concepts with Venn diagrams, in which the shaded portion indicates the
result set.
Figure: Result Set

Syntax

The following syntax diagram shows how to construct a UNION expression.


UNION expression:
.-(-.
|--+---+--query_expression-------------------------------------->
.-------------------------------------------------.
V
.-(-.
| .-)-.
>----+-UNION-----+--+-----+--+---+--query_expression-+--+---+---|
+-EXCEPT----+ '-ALL-'
'-INTERSECT-'
query_expression
Specifies any valid join or nonjoin query expression, as defined on page Syntax.
Each query expression in the statement must have the same number of columns in its select list. These
corresponding columns must be listed in the same order, but they do not have to have the same
names. The names of the columns in the result table are taken from the first query expression;
parentheses do not change this rule.
To define a different column heading for the result table, use the AS clause in the select list of the first
query expression; alternatively, if union_expressionoccurs in the FROM clause, provide headings by
using a correlation name and a column list (see page Table references).
Corresponding columns in each query expression must be of the same data type, or there must be a
valid implicit conversion between the data types. Smaller data types are converted to larger data types,
and less precise data types are converted to more precise data types. For example, if a column is of
data type REAL and the corresponding column is of data type FLOAT, the column in the result table
is FLOAT because FLOAT is more precise than REAL.
The data type conversion results table on page Data type conversions defines conversions between
data types of corresponding columns.
UNION, EXCEPT, INTERSECT
UNION combines the rows from two or more result sets into a single result set.
EXCEPT evaluates two result sets and returns all rows from the first set that are not also contained in
the second set.
INTERSECT computes a result set that contains the common rows from two result sets.
UNION, INTERSECT, and EXCEPT operators can be combined in a single UNION expression.
In statements that include multiple operators, the default order of evaluation (precedence) for these
operators is left to right; however, the INTERSECT operator is evaluated before UNION and EXCEPT.
The order of evaluation can be modified with parentheses.
ALL
If ALL is specified, duplicate rows returned by union_expression are retained. If two query expressions
return the same row, two copies of the row are returned in the final result. If ALL is not specified,
duplicate rows are eliminated from the result set.
In statements with multiple UNION, EXCEPT, and INTERSECT operators in which the ALL keyword is
used, the order of evaluation can affect the results. The placement of the ALL keyword in relation to the
query evaluation determines the duplicates that are retained and eliminated. If the last operation

performed does not contain the ALL keyword, any duplicates retained from previous evaluations are
eliminated.

Usage notes
The UNION and EXCEPT operators have the same precedence. A query with multiple operators is
evaluated from left to right. The following example:
query_expression1 union query_expression2 except query_expression3
is evaluated as:
(query_expression1 union query_expression2) except query_expression3
The INTERSECT operator has higher precedence than the UNION and EXCEPT operators. Therefore,
in the absence of parentheses, INTERSECT operations are always evaluated first. The example:
query_expression1 union query_expression2 intersect
query_expression3
is evaluated as:
query_expression1 union (query_expression2 intersect
query_expression3)
Parentheses that override the default precedence affect processing order and therefore which duplicate
rows are retained and eliminated.
Joins specified in union_expression take higher precedence than all three operators unless the default
order is changed with parentheses.
An INSERT INTO...SELECT statement can contain UNION, INTERSECT, and EXCEPT operators:
insert into orders.all
select * from orders.new
union
select * from orders.old
When queries use search conditions that contain OR connectives, you can sometimes improve
performance by rewriting those queries with UNION operators.

DMS Assignment B

Q1. Explain the DBMS architecture in detail.

o
o

Ans:
Data Modeling
A data model is used to describe the structure "logic" and "physics" of a database. Relationships,
data types and constraints are known as the structure or level, dividing into 2 types:
High Level - we call conceptual data model or Entity-Relationship model, its main concept is a
projection of the data that gets closest to the vision that the user has data.
Low - known as physical data model, is what provides a detailed view yet of how the data are
aramazenados computer.
Schemes
When using the term "description" of the database, as we understand the call of "schema of a
database" that is specified for a project database.
Instances
Instances are formed when a data is saved in the database for a certain time they formed these
database instances, being changed every time a change in the database is performed. DBMS
ensures that all instances satisfying the schema of the database, respecting its structure and its
constraints.
In a DBMS architecture has as main objective, separate user applications of physical data that
are divided from the diagrams below:

o
o
o

Level domestic or internal schema - uses a data model that shows the physical storage structure
of the database, the details of the saved data and access paths.
Level conceptual or conceptual scheme - performs a full description of the structure of the
database but did not offer details of the data stored in the database.
Level or external layout view - describes the views of the database to a group of users that shows
which users have access to this database.

Figure 1: Architecture of a DBMS Layers


Data Independence

We can say that is allowed to perform schema changes or level of a database without changing a
higher level. Recalling that only those levels or regimens are shown in Figure 1. Below is
representing two types of data independence:
o
o

o
o
o

o
o
o

Logical data independence: change only the conceptual level, without any change in the external
or in user applications.
Physical Data Independence: change the internally without having to change the conceptual
level, externally or user applications
Languages for Data Manipulation
The use of language DDL (Data Definition Language - Data Definition Language) is defined by the
conceptual and internal level. When there is a separation of internal and conceptual that is not
absorbed a clear view of the user, the DBMS has to compile the DDL action, with the action,
permission to execute the statements identified by their descriptions of schemes / levels where
you will store them in the DBMS catalog.
Where this detachment has an understanding of the user uses the language SDL (Storage
Definition Language - Storage Definition Language) for specifying schema / internally.
By the end, when the DBMS uses the architecture with three levels, the language used is VDL
(Vision Definition Language) that serves to deinio of views (views) of the database
When the developer has knowledge in language SQL (Strucuture Query Language) simply just
use the basic commands that form the language DDL, DML and DCL, which are described below:
DDL (commands that create objects) - CREATE TABLE, CREATE VIEW, CREATE INDEX, CREATE
PROCEDURE among thers.
DCL (commands that help in the security of the database) - GRANT, REVOKE.
DML (commands responsible for altering the data) - SELECT, DELETE, UPDATE, INSERT.
Classification of DBMS
Users: single user, are used in workstations, minicomputers and large machines.
Location: have 2 states located and distributed. When all data is located are on a single disk, if
the data is distributed across multiple machines.
Environment: it has two types, the homogeneous environment that is formed by a single DBMS
and heterogeneous environment that is composed of different DBMSs. One example is to have a
system running two types of database.

Figure 2: Structure of a System Manager Database

Q2. What is ER model? Draw ER diagram for a Hospital Management System.


Ans. ER Model is a high-level data model that is useful in developing a conceptual design for a
database. An ER model is a diagram containing entities or "items", relationships among them,
and attributes of the entities and the relationships.
In software engineering, an entityrelationship model (ER model for short) is an abstract and
conceptual representation of data. Entityrelationship modeling is a database modeling method,
used to produce a type of conceptual schema or semantic data model of a system, often
a relational database, and its requirements in a top-down fashion. Diagrams created by this
process are called entityrelationship diagrams or ER diagrams.
The building blocks: entities, relationships, and attributes

Two related entities

An entity with an attribute

ER diagram for a Hospital Management System

A relationship with an attribute

Q3. What is normalization? Explain different types of normal forms.


There are many different ways of designing good database. One of such methodologies is the method
involving Normalization. Normalization theory is built around the concept of normal forms.
Normalization reduces redundancy. Redundancy is unnecessary repetition of data. It can cause
problems with storage and retrieval of data. During the process of normalization, dependencies can be
identified, which can cause problems during deletion and updation. Normalization theory is based on
the fundamental notion of Dependency. Normalization helps in simplifying the structure of schema
and tables.
There are 5 different types of normal forms.

1. First Normal Form: A relation is in 1st Normal form (1NF) if and only if, in every legal value of
that relation, every tuple contains exactly one value for each attribute.
1NF relations have a number of discrepancies and therefore it not the most desirable form of a
relation.
Let us take a relation (modified to illustrate the point in discussion) as
Rel1 {S#, SUPPLYSTATUS, SUPPLYCITY, P#, PARTQTY}
Primary Key{S#, P#}
FD {SUPPLYCITY SUPPLYSTATUS}
2. Second

Normal Form
A relation is in 2NF if and only if it is in 1NF and every nonkey attribute is fully functionally
dependent on the primary key. Here it has been assumed that there is only one candidate key,
which is of course primary key.
A relation in 1NF can always decomposed into an equivalent set of 2NF relations. The reduction
process consists of replacing the 1NF relation by suitable projections.
We have seen the problems arising due to the less-normalization (1NF) of the relation. The
remedy is to break the relation into two simpler relations.
REL2{S#, SUPPLYSTATUS, SUPPLYCITY} and
REL3{S#, P#, PARTQTY}
REL2 and REL3 are in 2NF with their {S#} and {S#, P#} respectively. This is because all
nonkeys of REL1{ SUPPLYSTATUS, SUPPLYCITY}, each is functionally dependent on the
primary key that is S#. By similar argument, REL3 is also in 2NF. Evidently, these two
relations have overcome all the update anomalies stated earlier. Now it is possible to insert the
facts regarding supplier S5 even when he is not supplied any part, which was earlier not
possible. This solves insert problem. Similarly, delete and update problems are also over now.
INSERT: We are unable to insert the fact that a particular city has a particular status until we
have some supplier actually located in that city.
DELETE: If we delete sole REL2 tuple for a particular city, we delete the information that that
city has that particular status.
UPDATE: The status for a given city still has redundancy. This causes usual redundancy
problem related to update.
3. Third Normal Form

A relation is in 3NF if only if it is in 2NF and every non-key attribute is non-transitively


dependent on the primary key.

To convert the 2NF relation into 3NF, once again, the REL2 is split into two simpler relations
REL4 and REL5 as shown below.
RELATION 4 {S#, SUPPLYCITY}
and
RELATION 5
{SUPPLYCITY SUPLLYSTATUS}
Sample relation is shown below.
RELATION 4

RELATION 5

S#

SUPPLYCITY

S1
S2
S3
S4
S5

Madras
Mumbai
Mumbai
Madras
Kolkata

SUPPLYCITY

SUPPLYSTATUS

Madras
Mumbai
Kolakata

200
100
300

Evidently, the above relations RELATION 4 and RELATION5 are in 3NF, because there is no transitive

dependencies. Every 2NF can be reduced into 3NF by decomposing it further and removing any
transitive dependency.
4.

Boyce-Codd Normal Form


The previous normal forms assumed that there was just one candidate key in the relation and that
key was also the primary key. Another class of problems arises when this is not the case. Very
often there will be more candidate keys than one in practical database designing situation. To be
precise the 1NF, 2NF and 3NF did not deal adequately with the case of relations that had two or
more candidate keys, and that the candidate keys were composite, and they overlapped
(i.e. had at least one attribute common).
A relation is in BCNF (Boyce-Codd Normal Form) if and only if every nontrivial, leftirreducible
FD has a candidate key as its determinant. Or
A relation is in BCNF if and only if all the determinants are candidate keys.
5. Fifth Normal Form

It seems that the sole operation necessary or available in the further normalization process is the
replacement of a relation in a nonloss way by exactly two of its projections. This assumption has
successfully carried us as far as 4NF. It comes perhaps as a surprise, therefore, to discover that
there exist relations that cannot be nonloss-decomposed into two projections but can be
nonlossdecomposed
into three (or more). An unpleasant but convenient term, we will describe such a
relation as "n-decomposable" (for some n > 2) - meaning that the relation in question can be
nonloss-decomposed into n projections but not into m for any m < n.
A relation that can be nonloss-decomposed into two projections we will call "2-decomposable"
and similarly term n-decomposable may be defined.

Q4. Design an E/R diagram for the following situation:


We wish to model cities, counties and states in the US. For states, we wish to record the
name, population, and state capital (which would be a city). For counties, we wish to
record the name, the population, and the state in which it is located. For cities, we wish to
record the name, the population, the state in which it is located and the county/counties in
which it is located. Names of states are unique. Names of counties are only unique within
a state (e.g. 26 states have counties called "Washington"), and cities are likewise unique
only within a state (e.g., there is a city called "Lafayette" in Lousiana as well as Indiana).
Some counties and cities have the same name, even within a state (example: San
Francisco). Almost all cities are located within a single county, but some (e.g., New York
City) extend over several counties.

Co.
Popu.

Co.
name

Counties

Pop
u.
Located in1

Belongsto

Cities
Capital
Ci.
Popu.

Ci.
name

Name
States

Assignment C
Part A ( Q1-Q20)
1. What does acronym SQL stands for?
a) Standardized Query Language
b) Structured Query Language
c) Simple Query Language

2. List at least three examples of one-to-many relations:


a) mother and children, currency and bank account, inhabitants of town
b) authors and books, prime ministers and countries, client and rented car
c) students and courses, currency and bank account, flight and tourist

3. SELECT - SUM( ) - FROM - GROUP BY


a) is the projective query
b) is the action query
c) is used for creating queries which divide items into groups according to a given
attribute and an aggregate function

4. Which are the basic types of DB models?


a) networked, structured, centralized
b) networked, hierarchical, relational
c) relational, hierarchical, action
d) aggregate, projective, action

5. Key word DISTINCT will:


a) sum different data
b) list different values only once
c) add the distinct values
d) none of these

6. What does acronym DBMS stands for?


a) Database Management System
b) Database Management Structure
c) Database Management Standards
d) Database Management Studies

7. Keyword COUNT when used in query will:


a) group dynaset by defined attributes
b) answer the question "How many...?"
c) answer the question "What is the sum of ...?"

8. DML stands for:


a) Database Management Language

b) Data Manipulation Language


c) Data Multiplication Language
d) None of these

9. Which format does not belong to the type of Number:


a) integer
b) scientific
c) currency

10. Basic table structure is defined by:


a) attributes, fields
b) attributes, fields, values
c) records, fields, values

11. John is working in the customer table and needs to know what customers are located in
Florida. To find the information, he would.
a) create a new table
b) create a new query
c) create a new form
d) utilize the Database Wizard

12. Where does the DBMS store the definitions of data elements and their relationships?
a) Data file
b) Data dictionary
c) Index
d) Data map

13. When the DBMS translates logical requests into commands that physically locate and
retrieve the requested information, it is fostering data ____.
a) Integrity
b) Inconsistency
c) Independence
d) Mining
14. All of these are true about a database except
a) it is a shared, integrated structure
b) it must contain multiple tables
c) it stores user data
d) iit stores metadata
15. Metadata is:
a) raw facts
b) user created data
c) data about data
d) warehoused data

16. The DBMS stores definitions of the data elements and their relationships in a:
a) fixed length record
b) data dictionary
c) fixed length field
d) information diary
17. ____ is defined as "the condition in which all of the data in the database are consistent
with the real-world events and conditions."
a) data dictionary
b) data integrity
c) data anomaly
d) data processing
18. ____ is a DBMS function in which the DBMS creates and manages the complex
structures required for data storage.
a) data dictionary management
b) backup and recovery management
c) data storage management
d) database communication interfaces
19. The ___________ manages interaction between the end user and the database.
a) DM query engine
b) DBMQ
c) DBMS
d) DP
20. The hierarchical database model is based on a ____.
a) Tree Structure
b) Lack of a child segment
c) Lack of a parent segment
d) Matrix
Part B (Q21-40) Table Name = Library
No.

Title
1
2
3
4
5
6
7
8
9
10

Data Structure
Computer Studies
Adv. Pascal
DBASE dummies
Mastering C++
Guide Network
Mastering Access
DOS Guide
Basic for Beginners
Windows Guide

Write SQL commands

Author
Ajeet
Shivam
Vivek
Shivani
Manav
Robin
Divjot
Ankit
Ankita
Malvika

Type
DS
FND
PROG
DBMS
PROG
NET
DBMS
OS
PROG
OS

Pub
McGraw
Galgotia
McGraw
PustakM
BPB
ZPress
BPB
PH1
BPB
BPB

Qty.

Price
4
2
4
5
3
3
2
3
3
1

(Rs.)
217
75
350
130
295
200
135
175
40
225

1. To create the above table structure with proper constraints.


MySQL> CREATE TABLE Library (
column1 No_Int[(Not Null)] constraint,
column2 Title_Char[(Not Null)] constraint,
column3 Author_VarChar[(Not Null)] constraint,
column4 Type_Char[(20)] constraint,
column5 Pub_VarChar[(20)] constraint,
column6 Qty_Int[(Not Null)] constraint,
column7 Price_Int[(Not Null)] constraint,);

2. Select all the PROG type published by BPB from Library.


MySQL> SELECT TYPE
FROM Library
WHERE Pub = BPB;
3. Display a list of all books with Price more then 130 and sorted by Qty.
MySQL> SELECT *
FROM Library
WHERE price > 130.00
ORDER BY Quantity;
4. Display all the books sorted by Price in Ascending Order.
MySQL> SELECT *
FROM Library
ORDER BY Price ASC;
5. Display a report. Listing Book No. current value and misplacement charges for each book in the above table.
Calculate the misplacement charges for all books Price*1.25
MySQL> INSERT INTO Library (Misplacement_Charges int)
INSERT INTO Library VALUES (Misplacement_Charges int)
WHERE Misplacement_Charges = Price*1.25;

MySQL> SELECT *
FROM Library
WHERE Misplacement_Charges = Price*1.25
ORDER BY Title;

6. Count the number of books published by PHI


MySQL> SELECT *
FROM Library
WHERE Pub = PHI
ORDER BY Quantity;
7. Insert a new book in the Library.

MySQL> INSERT INTO Library VALUES (11, Title of Book, Author of Book, Type of Book, Pub of Book,
Qty. of Book, Price of Book);
8. Count the no of books in each Type.
MySQL> SELECT COUNT (DISTINCT publisher)
FROM Library
GROUP BY Type
ORDER BY Quantity;
9. Add one more attribute No_of_copies in the above table.
MySQL> INSERT INTO Library VALUES (no_of_copies int);
10. Update the new attribute value with 2 for each book.
MySQL> UPDATE Library VALUES (no_of_copies int);
11. Count the total number of Publishers.
MySQL> SELECT COUNT (DISTINCT pub)
FROM Library
GROUP BY Pub
ORDER BY Quantity;
12. Drop table Library.
MySQL> DROP Table Library;

Give the Output of the following SQL commands.


1. Select Count(Distinct Pub) from Library
Display a list of Total no of publisher
2. Select MIN(price) from Library where price<150
Display a list of all books with Price less then 150.
3. Select qty, SUM(qty) from Library GROUPBY Type.
Display all type of books and and sorted by Qty and Type.
4. Select AVG(price) from Library where qty<3.
Display average price of books Where qty of books less then three
5. Select * from Library where Qty IN(Select average(Qty) from Library));
Display quantity of books
Write relational algebraic expression for :
1. Find all books of Prog type.
Select task from library where type=program;
2. Find Pub, who publish FND Books.
Select Publisher from Library where publisher=FND;
3. Find all the PROG type published by PHI from Library.
Select task from library where publisher= PHI AND type=PROG;

Das könnte Ihnen auch gefallen