Search Header Logo

POSTGRE SQL Day-2

Authored by swaas 3

Other

1st - 5th Grade

Used 1+ times

POSTGRE SQL Day-2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

25 questions

Show all answers

1.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

How do you insert data into a table?

Table:

EMPLOYEES(NAME, DEPARTMENT, SALARY)

Values:

("JOHN DOE", "IT", 60000)

(a)  

2.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Write a SQL query to display the NAMES of EMPLOYEES who are assigned to more than one PROJECT.

INNER JOIN

Tables:

EMPLOYEES E(EMPLOYEEID, NAME)
PROJECTS P(PROJECTID, EMPLOYEEID)

The output should include the employee's NAME and the number of projects assigned as PROJECTCOUNT.

(a)  

3.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Write a PostgreSQL query to find the names of students who have scored more than 90 in any subject, using a subquery(NO JOIN)

Tables:

STUDENTS(STUDENTID, NAME, AGE)
MARKS(MARKID, STUDENTID, SUBJECTS, SCORE)

(a)  

4.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Write a PostgreSQL query to display the names of customers who have placed at least one order. Use a subquery, not a join.

Tables:

  • CUSTOMERS(CUSTOMERID, NAME, CITY)

  • ORDERS(ORDERID, CUSTOMERID, ORDERDATE, TOTALAMOUNT)



(a)  

5.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Query to Find 2nd Highest Salary Using Subquery:

Table:

EMPLOYEES(EMPID, NAME, SALARY)

THE COLUMN NAME AS SECONDHIGHESTSALARY

(a)  

6.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Query to Find 3rd Minimum Salary Using Subqueries

Table:

EMPLOYEES(EMPID, NAME, SALARY) COLUMN NAME AS THIRD_MIN_SALARY

(a)  

7.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

List all students who have never taken any exam. Use a subquery with NOT IN.

Tables:

  • STUDENTS(STUDENTID, NAME)

  • EXAMS(EXAMID, STUDENTID, SCORE)



(a)  

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?