CS Class 12 Tutorial

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 »

12. For the given database STUDENT-PROJECT, answer the following:
(a) Name primary key of each table.
(b) Find foreign key(s) in table PROJECT-ASSIGNED.

a) Name primary key of each table.b) Find foreign key(s) in table PROJECT-ASSIGNED.c) Is there any alternate key in table STUDENT? Give justification for your answer.d) Can a user assign duplicate value to the field RollNo of STUDENT table? Justify. Ans:(a) Table Primary key Student Registration_ID Project ProjectNo Project_assigned – (b) Registration_ID and ProjectNo(c) Yes,

12. For the given database STUDENT-PROJECT, answer the following:
(a) Name primary key of each table.
(b) Find foreign key(s) in table PROJECT-ASSIGNED.
Read More »

School uniform is available at M/s Sheetal Private Limited. They have maintained SCHOOL_UNIFORM Database with two relations viz. UNIFORM and COST. The following figure shows database schema and its state.

(a) Can they insert the following tuples to the UNIFORM Relation? Give reasons in support of your answer.(i) 7, Handkerchief, NULLAns: Yes, it can be inserted as UColor does not have Not Null constraint.(ii) 4, Ribbon, RedAns: No, it cannot be inserted as UCode is Primary key and 4 is already existing and so we

School uniform is available at M/s Sheetal Private Limited. They have maintained SCHOOL_UNIFORM Database with two relations viz. UNIFORM and COST. The following figure shows database schema and its state. Read More »

An organization wants to create a database EMPDEPENDENT to maintain following details about its employees and their dependent.
EMPLOYEE (AadharNumber, Name, Address, Department, EmployeeID)
DEPENDENT (EmployeeID, DependentName, Relationship)

a) Name the attributes of EMPLOYEE, which can be used as candidate keys.b) The company wants to retrieve details of dependent of a particular employee. Name the tables and the key which are required to retrieve this detail.c) What is the degree of EMPLOYEE and DEPENDENT relation? Ans: (a) AadharNumber, EmployeeID (b) To retrieve the

An organization wants to create a database EMPDEPENDENT to maintain following details about its employees and their dependent.
EMPLOYEE (AadharNumber, Name, Address, Department, EmployeeID)
DEPENDENT (EmployeeID, DependentName, Relationship)
Read More »

error: Content is protected !!