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

Explain how the associations are implemented as classes, Explain how the as...

Explain how the associations are implemented as classes. A general approach in this case is to transform an association class into a simple class linked to two original classes

Hangman, a method named WonGame that checks each letter in the word is matc...

a method named WonGame that checks each letter in the word is matched by its label

Define catalog and meta data, Define Catalog and meta data ? A catalog ...

Define Catalog and meta data ? A catalog is a compilation of records elaborating the contents of a particular collection or group of collections. Metadata (Meta data, or someti

What is a linked server, What is a Linked Server? Linked Servers is a m...

What is a Linked Server? Linked Servers is a method in SQL Server by which we can add other SQL Server to a Group and query both the SQL Server dbs using T-SQL Statements. With

E-R Diagram, The H. I. Topi School of Business operates international busin...

The H. I. Topi School of Business operates international business programs in 10 locations throughout Europe. The school had its first class of graduates in 1965. The school keep

Give expression in both tuple calculus and domain calculus, Consider the fo...

Consider the following relational schema: Doctor(DName,Reg_no) Patient(Pname, Disease) Assigned_To (Pname,Dname) Give expression in both Tuple calculus and Domain calculus for

Foreign keys , Foreign Keys and NULL Let us take the relation:         ...

Foreign Keys and NULL Let us take the relation:                 DEPT DEPT ID DNAME BUDGET D1 M

Writing a pl/sql program, Problem 1. Create a PL/SQL program to insert ...

Problem 1. Create a PL/SQL program to insert data into student table and display the details of the student having Reg.No 1010 Writing a PL/SQL program to Insert data

Explain the function of input controls, Explain the function of input contr...

Explain the function of input controls. Identify four types of input control and explain the function of each. Provide an example of a data integrity error that could occur i

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