Q458
The number of attributes in the following SQL table is . . . . . . . . CREATE TABLE employee ( emp_name CHAR(30), emp_id INT );
A.
30
B.
1
C.
2
AnswerD.
3
Answer: Option C
Solution
Answer: Option C
Solution:
This question asks about the number of attributes in a MySQL table. An attribute is like a column in the table, holding specific information about each row. Let's break down the code:
CREATE TABLE employee ( emp_name CHAR(30), emp_id INT ); This code creates a table named "employee".
emp_name CHAR(30) defines an attribute called emp_name (for employee name) that can store up to 30 characters. emp_id INT defines an attribute called emp_id (for employee ID) that stores integer values. Since we have two attributes (emp_name and emp_id), the correct answer is Option C: 2.