The number of attributes in the following SQL table is . . . . . . . .
CREATE TABLE employee (
emp_name CHAR(30),
emp_id INT
);
CREATE TABLE employee (
emp_name CHAR(30),
emp_id INT
);A. 30
B. 1
C. 2
D. 3
Answer: Option C
Solution (By Examveda Team)
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.
Related Questions on MySQL Miscellaneous
How is communication established with MySQL?
A. SQL
B. Network calls
C. A programming language like C++
D. APIs
Which type of database management system is MySQL?
A. Object-oriented
B. Hierarchical
C. Relational
D. Network

Join The Discussion