Write command to create table named ‘BOOK ‘ with following fields:
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
Answers
CREATE TABLE Book (Book ID CHAR (4),
B name VARCHAR(15),
Author VARCHAR(20),
Price DECIMAL) );
a). Book ID can be set as the primary key as it is unique for every book or, it identifies every book uniquely.
b).(i).
CHAR:-
Stores exactly the length specified by the user.
Pads with trailing spaces for shorter strings.
VARCHAR:-
Stores up to the specified length.
No padding.
(ii).
♦DDL:-
It stands for Data Definition/Description Language.
It is a standard for commands that define the structures in a database.
DDL statements create, modify, and remove database objects.
Common DDL statements are CREATE, ALTER, and DROP.
♦DML
It stands for Data Manipulation Language.
It enables the user to access and manipulate data in a database.
Data manipulation involves retrieval, insertion, deletion, and modification of information in a database.
DML statements are SELECT, INSERT, DELETE, and UPDATE.
Hope it hllpss...☺
Mark as brainliest!!!✌
Answer:
for creating book table