Class 11 Informatics Practices Chapter 8 Introduction to Structured Query Language SQL NCERT Exercise Solution

NCERT Exercise Solution Ch 8 – SQL

Introduction to Structured Query Language NCERT Exercise Solution

3. Fill in the blanks:

a) ____________ declares that an index in one table is related to that in another table.
i) Primary Key
ii) Foreign Key
iii) Composite Key
iv) Secondary Key

Answer: ii) Foreign Key

b) The symbol Asterisk (*) in a select query retrieves _________.
i) All data from the table
ii) Data of primary key only

iii) NULL data
iv) None of the mentioned

Answer: i) All data from the table


4. Consider the following MOVIE database and answer the SQL queries based on it.

MovieIDMovieNameCategoryReleaseDateProductionCostBusinessCost
001Hindi_MovieMusical2018-04-23124500130000
002Tamil_MovieAction2016-05-17112000118000
003English_MovieHorror2017-08-06245000360000
004Bengali_MovieAdventure2017-01-0472000100000
005Telugu_MovieAction100000
006Punjabi_MovieComedy30500

a) Retrieve movies information without mentioning their column names.

Answer: SELECT * FROM MOVIE;

b) List business done by the movies showing only MovieID, MovieName and BusinessCost.

Answer: SELECT MovieID, MovieName, BusinessCost FROM MOVIE;

c) List the different categories of movies.

Answer: SELECT DISTINCT(Category) FROM MOVIE;

d) Find the net profit of each movie showing its ID, Name and Net Profit.
(Hint: Net Profit = BusinessCost – ProductionCost)

Answer: SELECT MovieId, Name, BusinessCost – ProductionCost as ‘Net Profit’ FROM MOVIE;

Make sure that the new column name is labelled as NetProfit. Is this column now a part of the MOVIE relation. If no, then what name is coined for such columns? What can you say about the profit of a movie which has not yet released? Does your query result show profit as zero?

Answer: SELECT MovieId, Name, BusinessCost – ProductionCost as ‘Net Profit’ FROM MOVIE;

For unreleased movie, it will show NULL as empty values are shown as NULL and not as zero.

e) List all movies with ProductionCost greater than 80,000 and less than 1,25,000 showing ID, Name and ProductionCost.

Answer: SELECT MovieId, Name, ProductionCost FROM MOVIE WHERE ProductionCost > 80000 AND ProductionCost < 125000;

f) List all movies which fall in the category of Comedy or Action.

Answer: SELECT * FROM MOVIE WHERE category = ‘Comedy’ OR category =’Action’;

g) List the movies which have not been released yet.

Answer: SELECT * FROM MOVIE WHERE ReleaseDate IS NULL;


NCERT Book Exercise Solution – Class 11 Informatics Practices

You cannot copy content of this page

Scroll to Top