39. (a) Write a Query to create a Table with the following structure
Table Product
Field
PID
Pname
Description
Price
Datatype
Char(4)
Varchar(20)
Varchar(40)
Decimal
Answers
Answer:
CREATE TABLE "Product" [ 'PID' Char(4), 'Pname' Varchar(20) , 'Description' Varchar(40) , 'Price' Decimal ]
The SQL Query is
Create table Product ( PID CHAR (4), Pname VARCHAR (20), Description VARCHAR (40), Price DECIMAL);
Given data:
Table name: Product
Fields: PID, Pname, Description, Price
Datatypes: Char (4), Varchar (20), Varchar (40), Decimal
To write:
A query to create a table structure using given data.
Explanation:
To create a table structure in MySQL, you need to follow the syntax given below.
CREATE TABLE TABLE_NAME ( COLUMN1 DATATYPE(SIZE) [CONSTRAINTS], COLUMN2 DATATYPE(SIZE) [CONSTRAINTS], ...);
Constraints are optional here. Keywords in MySQL are case-insensitive.
The difference between CHAR and VARCHAR is, The CHAR data type is a fixed-length character type (0,255) while, VARCHAR isn't.
Learn more:
1. What are the maximum and the minimum number of rows returned by the R1 right outer join R2?
brainly.in/question/21195376
2. Write SQL commands for (a) to (e) on the basis of FAMILY relation given below:
https://brainly.in/question/15115256