G 12 CS Day 2
G 12 CS Day 2
Model-1 RevisionWorksheet
SECTION A (1 MARK)
1. Write the SQL command that is used to permanently save all changes made by the
current transaction to the database.
2. Which command is used to delete the records of the table.
3. command is used to modify or change the definition of already existing
schema objects
4. Write the SQL command that is used to modify a tuple in a table.
5. command will retrieve the information stored in the database.
6. key is called as non -key attribute,
7. The term is used to refer to a record in a table.
(a) Attribute (b) Tuple (c) Field (d) Instance
8. Which of the following is not a legal sub-language of SQL?
(a) DDL (b) QAL (c.) DML (d) TCL
9. Which command is used to remove a relation from an SQL?
(a) Drop table (b) Delete (c) Delete table (d) Remove
10. Which is the following not a DML command ?
(a) SELECT (b) UPDATE (c) DELETE (d) CREATE
SECTION B (2 MARK)
11. Give an example of a table which has one Primary key and two alternate keys. How
many Candidate keys will this table have?
12. Write the difference between alternate key and Primary key.
13. If a table Books has columns BookID, ISBN, Title, and Author, where BookID is the
Primary Key and both ISBN and Title are unique, what are the Alternate Keys and how
many candidate keys for this table?
14. Consider the table BorrowRecords has columns RecordID, MemberID, BookID are
unique column and BorrowDate.
i) what is the degree and cardinality of the table
ii) Which columns are eligible to become a primary key
15. What is data redundancy and data inconsistency.
19. Write a Python function named UpdateBookPrice() that connects to a MySQL database
and updates the price of a book in the BOOKS table based on the ISBN provided by the
user. Retrieve all the records from the table after updating.
Field Type
Book_name Varchar(20)
ISBN Int(11)
Edition Varchar(20)
Price Int(11)