Quiz Discussion

A foreign key is the one in which the ________ of one relation is referenced in another relation.

Course Name: SQL -Structured Query Language

  • 1]

    Foreign key

  • 2]

    Primary key

  • 3]

    References

  • 4]

    Check constraint

Solution
No Solution Present Yet

Top 5 Similar Quiz - Based On AI&ML

Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api

# Quiz
1
Discuss

Which of the following is not an integrity constraint?

  • 1]

    Not null

  • 2]

    Positive

  • 3]

    Unique

  • 4]

    Check ‘predicate’

Solution
2
Discuss

To include integrity constraint in an existing relation use :

  • 1]

    Create table

  • 2]

    Modify table

  • 3]

    Alter table

  • 4]

    Any of the above

Solution
3
Discuss

Which of the following is the right syntax for assertion?

  • 1]

    Create assertion 'assertion-name' check 'predicate';

  • 2]

    Create assertion check 'predicate' 'assertion-name';

  • 3]

    Create assertions 'predicates';

  • 4]

    All of the mentioned

Solution
4
Discuss
CREATE TABLE Employee(Empid NUMERIC NOT NULL, Name VARCHAR(20) , dept_name VARCHAR(20), Salary NUMERIC UNIQUE(Empid,Name));
INSERT INTO Employee VALUES(1002, Ross, CSE, 10000)
INSERT INTO Employee VALUES(1006,Ted,Finance, );
INSERT INTO Employee VALUES(1002,Rita,Sales,20000);

What will be the result of the query?

  • 1]

    All statements executed

  • 2]

    Error in create a statement

  • 3]

    Error in insert into Employee values(1006,Ted,Finance, );

  • 4]

    Error in insert into Employee values(1008,Ross,Sales,20000);

Solution
5
Discuss

Data integrity constraints are used to

  • 1]

    Control who is allowed access to the data

  • 2]

    Ensure that duplicate records are not entered into the table

  • 3]

    Improve the quality of data entered for a specific property (i.e., table column)

  • 4]

    Prevent users from changing the values stored in the table

Solution
6
Discuss

In order to ensure that the value of the budget is non-negative which of the following should be used? 

CREATE TABLE Manager(ID NUMERIC,Name VARCHAR(20),budget NUMERIC,Details VARCHAR(30));

 

  • 1]

    Check(budget>0)

  • 2]

    Check(budget<0)

  • 3]

    Alter(budget>0)

  • 4]

    Alter(budget<0)

Solution
7
Discuss

____________ is preferred method for enforcing data integrity.

  • 1]

    Constraints

  • 2]

    Stored Procedure

  • 3]

    Triggers

  • 4]

    Cursors

Solution
8
Discuss

Which of the following can be addressed by enforcing a referential integrity constraint?

  • 1]

    All phone numbers must include the area code

  • 2]

    Certain fields are required (such as the email address, or phone number) before the record is accepted

  • 3]

    Information on the customer must be known before anything can be sold to that custome

  • 4]

    When entering an order quantity, the user must input a number and not some text (i.e., 12 rather than ‘a dozen’)

Solution
9
Discuss

Which of the following is the right syntax for the assertion?

  • 1]

    Create assertion ‘assertion-name’ check ‘predicate’;

  • 2]

    Create assertion check ‘predicate’ ‘assertion-name’;

  • 3]

    Create assertions ‘predicates’;

  • 4]

    All of the mentioned

Solution
10
Discuss

Which of the following is used to delete the entries in the referenced table when the tuple is deleted in the course table?

CREATE TABLE course
( ...
FOREIGN KEY (dept name) REFERENCES department
... );

 

  • 1]

    Delete

  • 2]

    Delete cascade

  • 3]

    Set null

  • 4]

    All of the mentioned

Solution
# Quiz