SQL T2

SQL T2

University

23 Qs

quiz-placeholder

Similar activities

Pranata Komputer 10

Pranata Komputer 10

University

20 Qs

DBMS LAB

DBMS LAB

University

20 Qs

DBMS QUIZ-1

DBMS QUIZ-1

University

20 Qs

ภาษา SQL

ภาษา SQL

University

22 Qs

DBMS TCS503 DDL -2

DBMS TCS503 DDL -2

University

21 Qs

SQL

SQL

University

20 Qs

DBA CA 2

DBA CA 2

University

20 Qs

Advanced Excel

Advanced Excel

KG - University

20 Qs

SQL T2

SQL T2

Assessment

Quiz

Computers

University

Easy

Created by

Riddhish Thakore

Used 5+ times

FREE Resource

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.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?