. Create table BOOK
BOOK ID Char (4)
Bname Varchar (15)
Author Varchar (20)
Price Decimal
a) Identify the primary key of the Book Table, also mention the suitable reason for
choosing it as a Primary Key
b) Differentiate between
i. char and varchar data type
ii. DDL and DML
(5)
Answers
a)Primary key is the one which is used to uniquely identify all table records, since ID for every book would be unique and not null it is chosen as primary key , whereas book's name , author and price cud be duplicate too!
b)VARCHAR is variable-length.
CHAR is fixed length.
c)
DDL : Data definition language , contains commands which are related to database schema .
Examples of DDL commands:
CREATE – is used to create the database or its objects (like table, index, function, views, store procedure and triggers).
DROP – is used to delete objects from the database.
ALTER-is used to alter the structure of the database.
TRUNCATE–is used to remove all records from a table, including all spaces allocated for the records are removed.
COMMENT –is used to add comments to the data dictionary.
RENAME –is used to rename an object existing in the database.
DML: Data Manipulation Language. In SQL statements that are in the DML class are INSERT, UPDATE and DELETE. These commands are used to update or change data .
Examples of DML:
SELECT – is used to retrieve data from the a database.
INSERT – is used to insert data into a table.
UPDATE – is used to update existing data within a table.
DELETE – is used to delete records from a database table.
Answer:
Attachment below:-
Explanation:
Please mark as brainlist