Mysql Query Optimization
- Which is the correct format to store date in the SQL?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
1991-11-01
- Which of the following are the valid “database datatypes” in Mysql?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Temporal, Text and Numerical are the valid “database datatypes” in Mysql.
- Find the error?
CREATE TABLE Employee
( Employee_id SMALLINT, name VARCHAR, LAST VARCHAR
CONSTRAINTS pk_Employee PRIMARY KEY (Employee_id));
INSERT INTO Employee
VALUES( Employee_id, name, LAST)
(1, ’s’, ’p’);
INSERT INTO person
( Employee_id, name, LAST)
VALUES(1,’s’,’p’);
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Primary can never have same value.
- Find the error
CREATE TABLE Employee
(Employee_id SMALLINT, name VARCHAR, LAST VARCHAR, Bith_date DATE
CONSTRAINTS pk_Employee PRIMARY KEY (Employee_id));
INSERT INTO Employee
VALUES(Employee_id, name, LAST, Birth_date)
(1,’s’,’p’, 24-1991-01);
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Format for DATE datatype is YYYY-MM-DD.
- Which Key is used to link two tables in Mysql?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Foreign Key is only the Key which can link two tables.