Database Question 1
Which of the following is a group of one or more attributes that uniquely identifies a row?
Answer: A. Key
A determinant is the set of attributes on the left side of the functional dependency. A row of the relation is referred to as a tuple. In the Relational database, a table is referred to as a relation. A key is used to identify a row uniquely. A key is defined as an attribute or set of attributes that can be used to identify a row uniquely. So option A is correct.
Database Question 2
The primary key is selected from the:
- Composite keys.
- Candidate keys.
- Foreign keys.
Answer: C. Candidate keys
One of the candidate keys is selected as a primary key for the relation. The reason we select a candidate key to be the primary key is that a candidate key allows only unique and no-null values. A composite key and a foreign key may allow null values. So clearly, we can eliminate options A, B, and D.
Database Question 3
You can add a row using SQL in a database with which of the following?
Answer: C. INSERT
The ADD command is used to add a column to the existing table. To add or insert a new row in a database relation, we use the SQL command INSERT of the DML(Data Manipulation Language). CREATE is a DDL language command of SQL, which is used to create a database. So the correct answer is option C.
Database Question 4
The command to remove rows from a table 'CUSTOMER' is:
- REMOVE FROM CUSTOMER ...
- DROP FROM CUSTOMER ...
- DELETE FROM CUSTOMER WHERE ...
- UPDATE FROM CUSTOMER ...
Answer: C. DELETE FROM CUSTOMER WHERE ...
The command used to remove the rows from a particular table is "DELETE". If the complete table is required to be deleted, the command used is: DELETE FROM table name; else, if only rows based on some condition need to be deleted, then the command: DELETE FROM TABLE WHERE condition; is used. For table customers, the command will be: DELETE FROM CUSTOMER WHERE condition, so option C is the correct answer to the question.
Database Question 5
Which of the following is the original purpose of SQL?
- To specify the syntax and semantics of SQL data definition language.
- To specify the syntax and semantics of SQL manipulation language.
- To define the data structures.
- All of the above.
Answer: D. All of the above.
The SQL is further divided into three types that is DDL or Data Definition Language, DML or Data Manipulation Language, and DCL or Data Control Language, which help the user to create, manipulate and control data efficiently. Therefore D is the correct answer to the question.
☛ Related Questions:
Commentswrite a comment