Showing posts sorted by relevance for query C Control Statements. Sort by date Show all posts

Features of C

Features of C

It is a very simple and easy language, C language is mainly used for develop desktop based application. All other programming languages were derived directly or indirectly from C programming concepts. This language have following features;

  • Simple
  • Portability
  • Powerful
  • Platform dependent
  • Structure oriented
  • Case sensitive
  • Compiler based
  • Modularity
  • Middle level language
  • Syntax based language
  • Use of Pointers

Simple

Every c program can be written in simple English language so that it is very easy to understand and developed by programmer.

Platform dependent

A language is said to be platform dependent whenever the program is execute in the same operating system where that was developed and compiled but not run and execute on other operating system. C is platform dependent programming language.

Note: .obj file of C program is platform dependent.

Portability

It is the concept of carrying the instruction from one system to another system. In C Language .Cfile contain source code, we can edit also this code. .exe file contain application, only we can execute this file. When we write and compile any C program on window operating system that program easily run on other window based system.

When we can copy .exe file to any other computer which contain window operating system then it works properly, because the native code of application an operating system is same. But this exe file is not execute on other operation system.

Powerful

C is a very powerful programming language, it have a wide verity of data types, functions, control statements, decision making statements, etc.

Structure oriented

C is a Structure oriented programming language.Structure oriented programming language aimed on clarity of program, reduce the complexity of code, using this approach code is divided into sub-program/subroutines. These programming have rich control structure.

Modularity

It is concept of designing an application in subprogram that is procedure oriented approach. In c programming we can break our code in subprogram.
For example we can write a calculator programs in C language with divide our code in subprograms.

Example

void sum()
{
 .....
 .....
}
void sub()
{
 .....
 .....
}

Case sensitive

It is a case sensitive programming language. In C programming 'break and BREAK' both are different.
If any language treats lower case latter separately and upper case latter separately than they can be called as case sensitive programming language [Example c, c++, java, .net are sensitive programming languages.] other wise it is called as case insensitive programming language [Example HTML, SQL is case insensitive programming languages].

Middle level language

C programming language can supports two level programming instructions with the combination of low level and high level language that's why it is called middle level programming language.

Compiler based

C is a compiler based programming language that means without compilation no C program can be executed. First we need compiler to compile our program and then execute.

Syntax based language

C is a strongly tight syntax based programming language. If any language follow rules and regulation very strictly known as strongly tight syntax based language. Example C, C++, Java, .net etc. If any language not follow rules and regulation very strictly known as loosely tight syntax based language.
Example HTML.

Efficient use of pointers

Pointers is a variable which hold the address of another variable, pointer directly direct access to memory address of any variable due to this performance of application is improve. In C language also concept of pointer are available.

Compiler in C

Compiler in C

A compiler is system software which converts programming language code into binary format in single steps. In other words Compiler is a system software which can take input from other any programming language and convert it into lower level machine dependent language.

Interpreter

It is system software which is used to convert programming language code into binary format in step by step process.

Assembler

An assembler is system software which is used to convert the assembly language instruction into binary format in step by step process. An assembler is system software which is used to convert the assembly language instruction into binary format.

Compiler Vs Interpreter

NoCompilerInterpreter
1Compiler takes Entire program as input at a time.Interpreter takes Single instruction as input at a time.
2Intermediate Object code is generatedNo Intermediate Object code is generated
3It execute conditional control statements fastly.It execute conditional control statements slower than Compiler
4More memory is required.Less memory is required.
5Program need not to be compiled every timeEvery time higher level program is converted into lower level program
6It display error after entire program is checkedIt display error after each instruction interpreted (if any)
7Example: CExample: BASIC

Looping Statements

Looping statement

#Looping statement are the statements execute one or more statement repeatedly several number of times. In C programming language there are three types of loops; while, for and do-while.

Why use loop ?

When you need to execute a block of code several number of times then you need to use looping concept in C language.

Advantage with looping statement

  • Reduce length of Code
  • Take less memory space.
  • Burden on the developer is reducing.
  • Time consuming process to execute the program is reduced.

Types of Loops.

There are three type of Loops available in 'C' programming language.
  • while loop
  • for loop
  • do..while

Difference between conditional and looping statement

Conditional statement executes only once in the program where as looping statements executes repeatedly several number of time.

While loop

In while loop First check the condition if condition is true then control goes inside the loop body other wise goes outside the body. while loop will be repeats in clock wise direction.

Syntax

Assignment;
while(condition)
{
Statements;
......
Increment/decrements (++ or --);
}
Note: If while loop condition never false then loop become infinite loop.

Example of while loop

#include<stdio.h>
#include<conio.h>

void main()
{
int i;
clrscr();
i=1;
while(i<5)
{
printf("\n%d",i);
i++;
}
getch();
}

Output

1
2
3
4

For loop

for loop is a statement which allows code to be repeatedly executed. For loop contains 3 parts Initialization, Condition and Increment or Decrements.

Example of for loop

#include<stdio.h>
#include<conio.h>

void main()
{
int i;
clrscr();
for(i=1;i<5;i++)
{
printf("\n%d",i);
}
getch();
}

Output

1
2
3
4

do-while

do-while loop is similar to a while loop, except that a do-while loop is execute at least one time.
A do while loop is a control flow statement that executes a block of code at least once, and then repeatedly executes the block, or not, depending on a given condition at the end of the block (in while).

Syntax

do
{
Statements;
........
Increment/decrement (++ or --)
} while();

When use do..while Loop

When we need to repeat the statement block at least 1 time then we use do-while loop.

Example of do..while loop

#include<stdio.h>
#include<conio.h>

void main()
{
int i;
clrscr();
i=1;
do
{
printf("\n%d",i);
i++;
}
while(i<5);
getch();
}

Output

1
2
3
4

Nested loop

In Nested loop one loop is place within another loop body.
When we need to repeated loop body itself n number of times use nested loops. Nested loops can be design upto 255 blocks.

Function

Function

#A function is a group of statements that together perform a specific task. Every C program has at least one function, which is main().

Why use function ?

Function are used for divide a large code into module, due to this we can easily debug and maintain the code. For example if we write a calculator programs at that time we can write every logic in a separate function (For addition sum(), for subtraction sub()). Any function can be called many times.

Advantage of Function

  • Code Re-usability
  • Develop an application in module format.
  • Easily to debug the program.
  • Code optimization: No need to write lot of code.

Type of Function

There are two type of function in C Language. They are;
  • Library function or pre-define function.
  • User defined function.

Library function

Library functions are those which are predefined in C compiler. The implementation part of pre-defined functions is available in library files that are .lib/.obj files. .lib or .obj files are contained pre-compiled code. printf(), scanf(), clrscr(), pow() etc. are pre-defined functions.

Limitations of Library function

  • All predefined function are contained limited task only that is for what purpose function is designed for same purpose it should be used.
  • As a programmer we do not having any controls on predefined function implementation part is there in machine readable format.
  • In implementation whenever a predefined function is not supporting user requirement then go for user defined function.

User defined function

These functions are created by programmer according to their requirement for example suppose you want to create a function for add two number then you create a function with name sum() this type of function is called user defined function.

Defining a function.

Defining of function is nothing but give body of function that means write logic inside function body.

Syntax

 
return_type  function_name(parameter)
{
function body;
}
  • Return type: A function may return a value. The return_type is the data type of the value the function returns.Return type parameters and returns statement are optional.
  • Function name: Function name is the name of function it is decided by programmer or you.
  • Parameters: This is a value which is pass in function at the time of calling of function A parameter is like a placeholder. It is optional.
  • Function body: Function body is the collection of statements.

Function Declarations

A function declaration is the process of tells the compiler about a function name. The actual body of the function can be defined separately.

Syntax

return_type  function_name(parameter);
Note: At the time of function declaration function must be terminated with ;.

calling a function.

When we call any function control goes to function body and execute entire code. For call any function just write name of function and if any parameter is required then pass parameter.

Syntax

function_name(); 
    or  
variable=function_name(argument);  
Note: At the time of function calling function must be terminated with ';'.

Example of Function

 
#include<stdio.h>
#include<conio.h>

void sum(); // declaring a function
clrsct();
int a=10,b=20, c;

void sum()  // defining function
{
c=a+b;
printf("Sum: %d", c);
}
void main()
{
sum();  // calling function
}

Output

 
Sum: 30

Break Statement

Break Statement in C

#Break statement are used for terminates any type of loop e.g, while loop, do while loop or for loop. The break statement terminates the loop body immediately and passes control to the next statement after the loop. In case of inner loops, it terminates the control of inner loop only.

Use break statement

Break statement are mainly used with loop and switch statement. often use the break statement with the if statement.
  • with loop statement
  • with switch case
  • with if statement

Syntax

jump-statements (loop or switch case);
break;

Example of break

#include<stdio.h>
#include<conio.h>

void main()
{
char key;
 
printf("Press any key or E to exit:\n");
while(1)
{
scanf("%c", &key);
if (key == 'E' ||  key == 'e')
break;
}
printf("Good bye !\n");
}
Explanation:In the above code when user enter any character, if the user enters E or e, the break statement terminates the while loop and control is passed to the statement after the while loop that displays the Good bye !message.

Output

Press any key or E to exit
Good bye !

Database And SQL


Data :-             Raw facts and figures which are useful to an organization. We cannot take decisions on the basis of data.
Information:- Well processed data is called information. We can take decisions on the basis of information
Field:-             Set of characters that represents specific data element.
Record:           Collection of fields is called a record. A record can have fields of different data types.
File:                 Collection of similar types of records is called a file.
Table:              Collection of rows and columns that contains useful data/information is called a table. A table generally refers to the passive entity which is kept in secondary storage device.
Relation:         Relation (collection of rows and columns) generally refers to an active entity on which we can perform various operations.
Database:       Collection of logically related data along with its description is termed as database.
Tuple:                         A row in a relation is called a tuple.
Attribute:       A column in a relation is called an attribute. It is also termed as field or data item.
Degree:           Number of attributes in a relation is called degree of a relation.
Cardinality:   Number of tuples in a relation is called cardinality of a relation.
Primary Key: Primary key is a key that can uniquely identifies the records/tuples in a relation. This key can
                         never be duplicated and NULL.
Foreign Key: Foreign Key is a key that is defined as a primary key in some other relation. This key is used to enforce referential integrity in RDBMS.
Candidate Key: Set of all attributes which can serve as a primary key in a relation.
Alternate Key: All the candidate keys other than the primary keys of a relation are alternate keys for a                                                                    relation.
DBA:              Data Base Administrator is a person (manager) that is responsible for defining the data base schema, setting security features in database, ensuring proper functioning of the data bases etc.

Relational Algebra
The relation algebra is the collection of operations on relations. Each operation takes one or more relations (tables) and produces another relation as its result. The operations defined in relational algebra are select, project, Cartesian product, union, set difference, set interception, natural join, division etc.
1.      Select operation(denoted by σ ):- select operation is used to select rows from a elation <"
Let us consider the table item
ItemNo
Item_Name
Price
I1
Milk
10
I2
Bread
15
I3
Ice Cream
25
I4
Namkeen
20
I5
Cake
10

2.      Project Operation (denoted by Ï€):- Project operation select columns from a relation.
Consider above table Item
To display item name & price of all items from Item table we can write
Ï€ Item_Name, Price (Item)


Result will be
Item_Name
Price
Milk
10
Bread
15
Ice Cream
25
Namkeen
20
Cake
10

3.      The Cartesian product operation (denoted by X ):- the Cartesian product  of relation A and B is written as A X B. The Cartesian product  yield a new relation having degree (Degree of A + Degree of B) and Cardinality (cardinality of A  X  Cardinality of B)
Consider the following table student and instructor

The Cartesian product Student X Instructor result in following relation
Adno
Stu_Name
Passed
Id
Inst_name
Subject
1023
Ajay
Y
101
Manoj
CS
1023
Ajay
Y
102
Subhash
ACC
6151
Sunil
N
101
Manoj
CS
6151
Sunil
N
102
Subhash
ACC
7575
Vinay
y
101
Manoj
CS
7575
Vinay
y
102
Subhash
ACC

4.      The Union Operation (denoted by U):- it produces a relation that contains tuples from both operand relations.
Consider the following relations science and commerce

The result of Science U Commerce will be as follows
Adno
Name
Class
2190
Amit
XII
2345
Nihan
XII
5467
ajay
XI
5423
Sanjay
XII
7665
sumit
XI

5.      The Set Difference Operation (Denoted by - ):- allows to find tuples that are in one relation but not in another relation.
Consider above relation science and commerce
The result of Science - Commerce will be as follows
Adno
Name
Class
2190
Amit
XII
5467
ajay
XI

6.      The Set Interception Operation (denoted by ∩) :-Set Interception operation finds tuples that are common to the two operand relations.
Consider above relation science and commerce
The result of Science ∩ Commerce will be as follows
Adno
Name
Class
2345
Nihan
XII

Structured Query Language
SQL is a non-procedural language that is used to create, manipulate and process the databases(relations).
Characteristics of SQL
Ø  It is very easy to learn and use.
Ø  Large volume of databases can be handled quite easily.
Ø  It is non-procedural language. It means that we do not need to specify the procedures to accomplish a task but just to give a command to perform the activity.
Ø  SQL can be linked to most of other high level languages that makes it first choice for the database programmers.
Processing Capabilities of SQL
The following are the processing capabilities of SQL
1.      Data Definition Language (DDL)
DDL contains commands that are used to create the tables, databases, indexes, views, sequences and
synonyms etc.
e.g: Create table, create view, create index, alter table etc.
2.      Data Manipulation Language (DML)
DML contains command that can be used to manipulate the data base objects and to query the databases for information retrieval.
e.g Select, Insert, Delete, Update etc.
3.      Data Control Language:
This language is used for controlling the access to the data. Various commands like GRANT, REVOKE etc are available in DCL.
4.      Transaction Control Language (TCL)
TCL include commands to control the transactions in a data base system. The commonly used commands in TCL are COMMIT, ROLLBACK etc.

Data types of SQL
Support the following data types
Data Type
Syntax
Description
Example
NUMBER
Number(n,d)
·         Used to store a numeric value in a field/column
·        Where n specifies the number of digits and d specifies the number of digits after the decimal point.
Amt Number(6,2)
CHAR
Char (size)
Used to store fixed length string of length size
Name Char(20)
VARCHAR /
VARCHAR2
varchar(size) /
varchar2(size)
Used to store variable length string up to length size
Address Varchar2(30)
DATE
DATE
Used to store Date
DOB Date
LONG
LONG
This data type is used to store variable length strings of upto 2 GB size
Accno LONG
RAW/LONG RAW

RAW(bytes)/
LONG RAW(bytes)

Used to store binary data (images/pictures/animation/clips etc.) up to the size bytes
Address Raw(500)

1&2 mark questions
Q1. Define the terms:
(i)          Database Abstraction
(ii)        Data inconsistency
(iii)      Conceptual level of database implementation/abstraction
(iv)      Primary Key
(v)        Candidate Key
(vi)      Relational Algebra
(vii)    Domain
Ans:. Define the terms:
i. Database Abstraction
Ans: Database system provides the users only that much information that is required by them, and hides certain details like, how the data is stored and maintained in database at hardware level. This concept/process is Database abstraction.
ii. Data inconsistency
Ans: When two or more entries about the same data do not agree i.e. when one of them stores the updated information and the other does not, it results in data inconsistency in the database.
iii. Conceptual level of database implementation/abstraction
Ans: It describes what data are actually stored in the database. It also describes the relationships existing among data. At this level the database is described logically in terms of simple data-structures.
iv. Primary Key
Ans : It is a key/attribute or a set of attributes that can uniquely identify tuples within the relation.
v. Candidate Key
Ans : All attributes combinations inside a relation that can serve as primary key are candidate key as they are candidates for being as a primary key or a part of it.
vi. Relational Algebra
Ans : It is the collections of rules and operations on relations(tables). The various operations are  selection, projection, Cartesian product, union, set difference and intersection, and joining of relations.
vii. Domain
Ans : it is the pool or collection of data from which the actual values appearing in a given column are drawn.

2 marks Practice questions
1.      What is relation? What is the difference between a tuple and an attribute?
2.      Define the following terminologies used in Relational Algebra:
(i)                 selection (ii) projection (iii) union (iv) Cartesian product
3.      What are DDL and DML?
4.      Differentiate between primary key and candidate key in a relation?
5.      What do you understand by the terms Cardinality and Degree of a relation in relational database?
6.      Differentiate between DDL and DML. Mention the 2 commands for each category.

Database and SQL : 6 marks questions
1.      Write SQL Command for (a) to (d) and output of (g)
TABLE : GRADUATE
S.NO
NAME
STIPEND
SUBJECT
AVERAGE
DIV
1
KARAN
400
PHYSICS
68
I
2
DIWAKAR
450
COMP  Sc
68
I
3
DIVYA
300
CHEMISTRY
62
I
4
REKHA
350
PHYSICS
63
I
5
ARJUN
500
MATHS
70
I
6
SABINA
400
CHEMISTRY
55
II
7
JOHN
250
PHYSICS
64
I
8
ROBERT
450
MATHS
68
I
9
RUBINA
500
COMP  Sc
62
I
10
VIKAS
400
MATHS
57
II

a.       List the names of those students who have obtained DIV I sorted by NAME.
b.      Display a report, listing NAME, STIPEND, SUBJECT and amount of stipend received in a year assuming that the STIPEND is paid every month.
c.       To count the number of students who are either PHYSICS or COMPUTER SC graduates.
d.      To insert a new row in the GRADUATE table: 11,”KAJOL”, 300, “computer sc”, 75, 1
e.       Give the output of following sql statement based on table GRADUATE:
(i)          Select MIN(AVERAGE) from GRADUATE where SUBJECT=”PHYSICS”;
(ii)        Select SUM(STIPEND) from GRADUATE WHERE div=2;
(iii)      Select AVG(STIPEND) from GRADUATE where AVERAGE>=65;
(iv)      Select COUNT(distinct SUBJECT) from GRADUATE;
Sol :
a.       SELECT NAME from GRADUATE where DIV = ‘I’ order by NAME;
b.      SELECT NAME,STIPEND,SUBJECT, STIPEND*12 from GRADUATE;
c.       SELECT SUBJECT,COUNT(*) from GRADUATE group by SUBJECT having SUBJECT=’PHYISCS’ or SUBJECT=’COMPUTER SC’;
d.      INSERT INTO GRADUATE values(11,’KAJOL’,300,’COMPUTER SC’,75,1);
e.       (i)         63
(ii)        800
(iii)       475
(iv)       4

2.      Consider the following tables Sender and Recipient. Write SQL commands for the statements (i) to (iv) and give the outputs for SQL queries (v) to (viii).
Sender
SenderID
SenderName
SenderAddress
City
ND01
R Jain
2, ABC Appls
New Delhi
MU02
H Sinha
12 Newtown
Mumbai
MU15
S Jha
27/A, Park Street
Mumbai
ND50
T Prasad
122-K,SDA
New Delhi

Recipients
RecID
SenderID
RecName
RecAddress
recCity
KO05
ND01
R Bajpayee
5, Central Avenue
Kolkata
ND08
MU02
S Mahajan
116, A-Vihar
New Delhi
MU19
ND01
H Singh
2A, Andheri East
Mumbai
MU32
MU15
P K Swamy
B5, C S Terminals
Mumbai
ND48
ND50
S Tripathi
13, BI D Mayur Vihar
New delhi
(i)                 To display the names of all Senders from Mumbai
Ans.           SELECT sendername from Sender
where sendercity=’Mumbai’;
(ii)                To display the RecIC, Sendername, SenderAddress, RecName, RecAddress for every
Recipient.
Ans.           Select R.RecIC, S.Sendername, S.SenderAddress, R.RecName, R.RecAddress
from Sender S, Recepient R
where S.SenderID=R.SenderID ;
(iii)             To display Recipient details in ascending order of RecName
Ans.           SELECT * from Recipent ORDER By RecName;
(iv)             To display number of Recipients from each city
Ans.           SELECT COUNT( *) from Recipient
Group By RecCity;
(v)               SELECT DISTINCT SenderCity from Sender;
Ans.
SenderCity
Mumbai
New Delhi
(vi)             SELECT A.SenderName, B.RecName From Sender A, Recipient B
Where A.SenderID = B.SenderID AND B.RecCity =’Mumbai’;
Ans.           A.SenderName                      B.RecName
R Jain                                      H Singh
S Jha                                        P K Swamy
(vii)           SELECT RecName, RecAddress From Recipient
Where RecCity NOT IN (‘Mumbai’, ‘Kolkata’) ;
Ans.           RecName                    RecAddress
S Mahajan                   116, A Vihar
S Tripathi                     13, BID, Mayur Vihar
(viii)          SELECT RecID, RecName FROM Recipent
Where SenderID=’MU02’ or SenderID=’ND50’;
Ans.           RecID                         RecName
ND08              S Mahajan
ND48              STripathi

3.      Write SQL command for (a) to (f) on the basis of the table SPORTS
Table: SPORTS
Student
NO

Class
Name
Game1
Grade
Game2
Grade2

10
7
Sammer
Cricket
B
Swimming
A
11
8
Sujit
Tennis
A
Skating
C
12
7
Kamal
Swimming
B
Football
B
13
7
Venna
Tennis
C
Tennis
A
14
9
Archana
Basketball
A
Cricket
A
15
10
Arpit
Cricket
A
Atheletics
C
a.     Display the names of the students who have grade ‘C’ in either Game1 or Game2 or both.
b.    Display the number of students getting grade ‘A’ in Cricket.
c.     Display the names of the students who have same game for both Game1 and Game2.
d.    Display the games taken up by the students, whose name starts with ‘A’.
e.     Add a new column named ‘Marks’.
f.        Assign a value 200 for Marks for all those who are getting grade ‘B’ or grade ‘A’ in both Game1 and Game2.

Ans : a) SELECT Name from SPORTS where grade=’C’ or Grade2=’C’;
b) SELECT Count(*) from SPORTS where grade=’A’;
c) SELECT name from SPORTS where game1 = game2;
d) SELECT game,game2 from SPORTS where name like ‘A%’;
e) ALTER TABLE SPORTS add (marks int(4));
f) UPDATE SPORTS set marks=200 where grade=’A’;

4.      Consider the following tables Stationary and Consumer. Write SQL commands for the statement (i) to (iv) and output for SQL queries (v) to (viii):
Table: Stationary
S_ID
StationaryName
Company
Price
DP01
Dot Pen
ABC
10
PL02
Pencil
XYZ
6
ER05
Eraser
XYZ
7
PL01
Pencil
CAM
5
GP02
Gel Pen
ABC
15

Table: Consumer
C_ID
ConsumerName
Address
S_ID
01
Good Learner
Delhi
PL01
06
Write Well
Mumbai
GP02
12
Topper
Delhi
DP01
15
Write & Draw
Delhi
PL02
16
Motivation
Banglore
PL01
(i)                 To display the details of those consumers whose Address is Delhi.
(ii)               To display the details of Stationary whose Price is in the range of 8 to 15. (Both Value included)
(iii)             To display the ConsumerName, Address from Table Consumer, and Company and Price from table Stationary, with their corresponding matching S_ID.
(iv)             To increase the Price of all stationary by 2.
(v)               SELECT DISTINCT Address FROM Consumer;
(vi)              SELECT Company, MAX(Price), MIN(Price), COUNT(*) from Stationary GROUP BY Company;
(vii)            SELECT Consumer.ConsumerName, Stationary.StationaryName, Stationary.Price FROM Strionary, Consumer WHERE Consumer.S_ID=Stationary.S_ID;
(viii)         Select StationaryName, Price*3 From Stationary;

5.      Consider the following tables GARMENT and FABRIC. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii).
Table : GARMENT
GCODE
DESCRIPTION
PRICE
FCODE
READYDATE
10023
PENCIL SKIRT
1150
F03
19–DEC–08
10001
FORMAL SHIRT
1250
F01
12–JAN–08
10012
INFORMAL SHIRT
1550
F02
06–JUN–08
10024
BABY TOP
750
F03
07–APR–07
10090
TULIP SKIRT
850
F02
31–MAR–07
10019
EVENING GOWN
850
F03
06–JUN–08
10009
INFORMAL PANT
1500
F02
20–OCT–08
10007
FORMAL PANT
1350
F01
09–MAR–08
10020
FROCK
850
F04
09–SEP–07
10089
SLACKS
750
F03
20–OCT–08

Table : FABRIC
FCODE
TYPE
F04
POLYSTER
F02
COTTON
F03
SILK
F01
TERELENE

(i)                 To display GCODE and DESCRIPTION of a each dress in descending order of GCODE.
(ii)               To display the details of all the GARMENTs, which have READYDATE in between 08–DEC–07 and 16–JUN–08 (inclusive of both the dates).
(iii)             To display the average PRICE of all the GARMENTs, which are made up of FABRIC with FCODE as F03.
(iv)             To display FABRIC wise highest and lowest price of GARMENTs from DRESS table. (Display FCODE of each GARMENT along with highest and lowest price)
(v)               SELECT SUM (PRICE) FROM GARMENT WHERE FCODE= ‘F01’;
(vi)             SELECT DESCRIPTION, TYPE FROM GARMENT, FABRIC WHERE GARMENT.FCODE = FABRIC. FCODE AND GARMENT. PRICE>=1260;
(vii)           SELECT MAX (FCODE) FROM FABRIC;
(viii)         SELECT COUNT (DISTINCT PRICE) FROM FABRIC;