Professional Documents
Culture Documents
Batch 1 - Set B - Answer Key
Batch 1 - Set B - Answer Key
Number
SRM Institute of Science and Technology
College of Engineering and Technology
School of Computing BATCH 1 SET B
SRM Nagar, Kattankulathur – 603203, Chengalpattu District, Tamilnadu
Academic Year: 2022-2023 (EVEN SEM)
Test: CLAT-2 Date: 12/04/2023
Course Code & Title: 18CSC303J & DATABASE MANAGEMENT SYSTEMS Duration: 8 am to 9.40 am
Year & Sem: III & VI Max. Marks: 50
Instruction: MCQs to be collected within first 15 minutes
Course Articulation Matrix:
S.No. Course Outcome PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
1 CO2 H M L
2 CO3 H M L
3 CO4 H M L
7 Which is the operator used to find out the matching between the string 1 1 4 1 1.6.1
a. * b. / c. % d. +
Table Constraint
Create TABLE Sailors (sid INTEGER,
sname CHAR(10),
rating INTEGER,
age INTEGER,
PRIMARY KEY (sid),
CHECK (rating gt 1 AND rating
lt10))
Domain Constraints
Distinct Types
Assertions
2. Partial Participation-
2. One-to-Many cardinality
relationships
3. Many-to-one cardinality
4. Many-to-many cardinality
14 What are the privileges that can be granted on a table by a user to others? 4 3 4 2 2.6.1
ALTER
Change the table definition with the ALTER TABLE
statement.
DELETE
Remove rows from the table with the DELETE
statement. You must grant the SELECT privilege on
the table along with the DELETE privilege.
INDEX
Create an index on the table with the CREATE
INDEX statement.
INSERT
Add new rows to the table with the INSERT
statement.
REFERENCES
Create a constraint that refers to the table. You
cannot grant this privilege to a role.
SELECT
Query the table with the SELECT statement.
UPDATE
Change data in the table with the UPDATE
statement. You must grant the SELECT privilege
on the table along with the UPDATE privilege
Creating view
A view can be created using the CREATE
VIEW statement. We can create a view from a single
table or multiple tables.
Syntax:
Answer:
(If we are considering the worker id is asked from the worker table in
the question);
(or)
(If we are considering the worker id is take from the bonus table in the
question)
( OR)
17 (i) Create a PL/SQL procedure for identifying the input string as 12 4 4 3 3.6.2
(b) palindrome or not.
DECLARE
s VARCHAR2(10) := 'abccba';
l VARCHAR2(20);
t VARCHAR2(10);
BEGIN
FOR i IN REVERSE 1..Length(s) LOOP
l := Substr(s, i, 1);
t := t
||''
||l;
END LOOP;
IF t = s THEN
dbms_output.Put_line(t
||''
||' is palindrome');
ELSE
dbms_output.Put_line(t
||''
||' is not palindrome');
END IF;
END;
Output:
abccba is palindrome