Give an expression within sql for queries, Database Management System

Assignment Help:

Consider the following relations:

 S (S#, SNAME, STATUS, CITY)

 SP (S#, P#, QTY)

 P (P#, PNAME, COLOR, WEIGHT, CITY)

Give an expression within SQL for each of queries below:

(i) Get supplier names for supplier who supply at least one red part

(ii) Get supplier names for supplier who do not supply part P2.

(i) SELECT SNAME FROM S

WHERE S# IN (SELECT S# FROM SP

WHERE P# IN (SELECT P# FROM P

WHERE COLOR = RED'))

(ii) SELECT SNAME FROM S

WHERE S# NOT IN (SELECT S# FROM SP WHERE P# = 'P2')


Related Discussions:- Give an expression within sql for queries

Division operation, To do the division operation R1 ÷ R2, R2 should be a co...

To do the division operation R1 ÷ R2, R2 should be a correct subset of R1. In the following example R1 have attributes A and B and R2 have only attribute B so R2 is a correct subse

Explain controlled redundancy, Explain controlled redundancy? Controll...

Explain controlled redundancy? Controlled redundancy : The replication of data within the data warehouse for the purposes of improved data access or understand ability.

Define raid structure, Define raid? Briefly explain it? A range of disk...

Define raid? Briefly explain it? A range of disk organization methods, collectively called redundant arrays of independent disks (RAID) o   Improvement of reliability throug

Constraints violation during insertion, If the insertion violates one or mo...

If the insertion violates one or more constraints, then two alternatives are available: Default option: - Insertion can be discarded and the reason of refusal can also be ex

Data integrity, You are required to implement integrity constraints within ...

You are required to implement integrity constraints within the database to enforce the following requirements:  For Projects: Start date must be supplied. Start date cannot be i

Lock, intent locking

intent locking

Example of equijoin, Example: Consider the following relations: ...

Example: Consider the following relations: ROLLNO NAME ADDRESS COURSE_ID 100 Ka

What is a transaction, What is a Transaction? A transaction is an even...

What is a Transaction? A transaction is an event which happens on the database. Generally a transaction reads a value from the database or writes a value to the database. If y

Relational database, Convert the following ER - diagram (Entity Relationsh...

Convert the following ER - diagram (Entity Relationship Diagram) into a relational database (the primary keys are underlined): 2160_Convert the following ER - diagram into a

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd