Search Header Logo

SQL T2

Authored by Riddhish Thakore

Computers

University

Used 6+ times

SQL T2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

23 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

___________ and __________constraints form the core of the PRIMARY KEY constraint.

NOT NULL , CHECK
CHECK ,UNIQUE
NOT NULL , FOREIGN KEY
NOT NULL , UNIQUE

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To modify the students table and to add a primary key on the student_id Column, Which statement must be used to accomplishes this task? Note: The table is currently empty.

alter table students add primary key (student_id);
Alter table students add constraint primary key (student_id);
Alter table students add constraint stud_id_pk primary key (student_id);
A&C BOTH

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is TRUE about UNIQUE constraint?

In columns that are subject to the UNIQUE constraint, duplicate values are not allowed.
Unique values will always be present in the column containing the unique constraint.
A single table can have more than one unique constraint, since it can be applied to more than one column.
All of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Purpose of foreign key constraint in SQL Server is __________

FOREIGN KEY constraints identify and enforce the relationships between tables
A foreign key in one table points to a candidate key in another table
You cannot insert a row with a foreign key value, except NULL, if there is no candidate key with that value
None of the mentioned

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for using the AVG() function in PostgreSQL?

SELECT AVG(column_name) FROM table_name;
SELECT AVG FROM column_name FROM table_name;
SELECT AVG(table_name) FROM column_name;
SELECT AVG(column_name, table_name) FROM table_name;

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the COUNT function in PostgreSQL do?

Counts the occurrences of a specific value in a column.
Calculates the average value of a numeric column.
Returns the highest value in a column.
find the number of values in the specified column excluding NULL values

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the MAX function in PostgreSQL?

Retrieves the highest value from a specified column.
Calculates the average value of a numeric column.
Returns the number of rows in a specified table or view.
Counts the occurrences of a specific value in a column.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers