IP Class 11 Tutorial

An organization ABC maintains a database EMP-DEPENDENT to record the following details about its employees and their dependents.

EMPLOYEE (AadhaarNo, Name, Address, Department, EmpID)DEPENDENT (EmpID, DependentName, Relationship)Use the EMP-DEPENDENT database to answer the following SQL queries:(a) Find the names of employees with their dependent names.Ans:         Select E.Name, D.DependentName FROM EMPLOYEE E, DEPENDENT DWHERE E.EmpID = D.EmpID;(b) Find employee details working in a department, say, ‘PRODUCTION’.Ans:         SELECT * FROM EMPLOYEE WHERE Department = ‘PRODUCTION’;(c) Find employee […]

An organization ABC maintains a database EMP-DEPENDENT to record the following details about its employees and their dependents. Read More »

Create a database called STUDENT_PROJECT having the following tables. Choose appropriate data type and apply necessary constraints.

Table: STUDENT RollNo Name Stream Section RegistrationID *The values in Stream column can be either Science, Commerce, or Humanities.* The values in Section column can be either I or II.Ans:CREATE TABLE STUDENT (RollNo INT NOT NULL UNIQUE,Name varchar(20) NOT NULL,Stream varchar(20) CHECK (Stream IN (‘Science’, ‘Commerce’, ‘Humanities’)),Section varchar(2) CHECK (Section IN (‘I’, ‘II’)),RegistrationID int PRIMARY

Create a database called STUDENT_PROJECT having the following tables. Choose appropriate data type and apply necessary constraints. Read More »

Using the sports database containing two relations (TEAM, MATCH_DETAILS), answer the following relational algebra queries.

(a) Retrieve the MatchID of all those matches where both the teams have scored > 70.Ans:  SELECT MatchID FROM MATCH_DETAILSWHERE FirstTeamScore >70 AND SecondTeamScore >70;(b) Retrieve the MatchID of all those matches where FirstTeam has scored < 70 but SecondTeam has scored > 70.Ans:SELECT MatchID FROM MATCH_DETAILSWHERE FirstTeamScore <70 AND SecondTeamScore >70;(c) Find out the MatchID

Using the sports database containing two relations (TEAM, MATCH_DETAILS), answer the following relational algebra queries. Read More »

Suppose your school management has decided to conduct cricket matches between students of class XI and Class XII. Students of each class are asked to join any one of the four teams — Team Titan, Team Rockers, Team Magnet and Team Hurricane. During summer vacations, various matches will be conducted between these teams. Help your sports teacher to do the following:

(a) Create a database “Sports”.Ans: CREATE DATABASE Sports;(b) Create a table “TEAM” with following considerations:It should have a column TeamID for storing an integer value between 1 to 9, which refers to unique identification of a team.Each TeamID should have its associated name (TeamName), which should be a string of length not less than 10

Suppose your school management has decided to conduct cricket matches between students of class XI and Class XII. Students of each class are asked to join any one of the four teams — Team Titan, Team Rockers, Team Magnet and Team Hurricane. During summer vacations, various matches will be conducted between these teams. Help your sports teacher to do the following: Read More »

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

MovieID MovieName Category ReleaseDate ProductionCost BusinessCost 001 Hindi_Movie Musical 2018-04-23 124500 130000 002 Tamil_Movie Action 2016-05-17 112000 118000 003 English_Movie Horror 2017-08-06 245000 360000 004 Bengali_Movie Adventure 2017-01-04 72000 100000 005 Telugu_Movie Action – 100000 – 006 Punjabo_Movie Comedy – 30500 – (a) Retrieve movies information without mentioning their column names.Ans: SELECT * FROM MOVIE;(b)

Consider the following MOVIE database and answer the SQL queries based on it. Read More »

2. Choose appropriate answer with respect to the following code snippet.
CREATE TABLE student ( name CHAR(30), student_id INT, gender CHAR(1), PRIMARY KEY (student_id));

(i) What will be the degree of student table?a) 30b) 1c) 3d) 4Ans: 3 (degree means columns and total no of columns are 3) (ii) What does ‘name’ represent in the above code snippet?a) A tableb) A rowc) A columnd) A databaseAns: A column (iii) What is true about the following SQL statement?SelecT * fROM

2. Choose appropriate answer with respect to the following code snippet.
CREATE TABLE student ( name CHAR(30), student_id INT, gender CHAR(1), PRIMARY KEY (student_id));
Read More »

error: Content is protected !!